REST API, also known as (application programming interface), is commonly used to provide web services interaction. All interactions between applications, data and devices have APIs as serving bridge between software applications.
The RESTful API accesses Odoo using standard HTTP GET, PUT, POST, and DELETE methods and a simple JSON and XML input and output format.
Our Odoo Rest API provides both, OAuth1, OAuth2 and a new protocol known as Basic Authentication is developed by our company "Synconics Technologies", is also added to authenticate Odoo.
Please refer the following link as quick reference guide to use Odoo RestAPI https://bit.ly/3QI4219
- Community
-
Enterprise
(On-premises) - Odoo.sh
- Online
Authentication
Creates Records
Delete Records
Print Reports
Fetching of Records
Updates Records
Calling Methods in Odoo
Authentication | Provides authorization with both Oauth1, Oauth2 and Basic protocols |
---|---|
Creates Records | Creating records in odoo |
Delete Records | Deleting records in odoo |
Print Reports | Supports report printing |
Fetching of Records | Super easy to fetch records of any odoo objects |
Updates Records | Updates records in odoo. |
Calling Methods | Calling methods in odoo |
The Odoo version information can be checked with following request
GET /restapi/1.0/common/version
Using the following request, user can authenticate using Oauth1 protocol.
Step1: Temporary Credential Request endpoint:
POST /restapi/1.0/common/oauth1/request_token
Step2: Resource Owner Authorization endpoint:
GET /restapi/1.0/common/oauth1/authorize
Step3: Token Credentials Request endpoint:
POST /restapi/1.0/common/oauth1/access_token
Using the following request, user can authenticate using Oauth2 protocol.
Step1: Resource Owner Authorization endpoint:
GET /restapi/1.0/common/oauth2/authorize
Step2: Token Credentials Request endpoint:
POST /restapi/1.0/common/oauth2/access_token
Using the following request, user can authenticate using Basic protocol.
Basic Authentication is an authentication protocol where the client's credentials (e.g., username:password) are encoded in Base64 and sent in the HTTP Authorization header in the following format: Authorization: Basic {encoded_string}.
Basic Authentication works in Odoo if the "Allow Basic Authentication" group is enabled for a user otherwise, the system will respond with a 401 error.
Using the following request, user can check the access rights of current objects
GET /restapi/1.0/object/{object_name}/check_access_rights?operation={list_of_operations}
Using the following request, user can get a list record of current objects.
GET /restapi/1.0/object/{object_name}/search
Using the following request, the user can count the number of records of current objects.
GET /restapi/1.0/object/{object_name}/search_count
Using following request, the user can read records, fetch individual records, read record sets and filter records.
Read Single Record:
GET /restapi/1.0/object/{object_name}/{id}
Read Record Set:
GET /restapi/1.0/object/{object_name}?ids={comma_separated_ids}
Read Filter Records:
GET /restapi/1.0/object/{object_name}/?domain={comma_separated_list_of_args}
Using the following request, the user can fetch the listening field of the current object.
GET /restapi/1.0/object/{object_name}/fields_get
Using the following request, users can update the current record and more than one record.
Update Single Record:
PUT /restapi/1.0/object/{object_name}/{id}?vals={fields_and_values_to_update}
Update Record Set:
PUT /restapi/1.0/object/{object_name}?ids={comma_separated_ids}&vals={fields_and_values_to_update}
Using the following request, users can delete individual records and more than one record.
Delete Single Record:
DELETE /restapi/1.0/object/{object_name}/{id}
Delete Record Set:
DELETE /restapi/1.0/object/{object_name}?ids={comma_separated_ids}
Using the following request, users can print individual reports
Print Single Record:
GET /restapi/1.0/report/{report_name}/{id}
Print Record Set:
GET /restapi/1.0/report/{report_name}?ids={comma_separated_ids}
An inspection provides information about Odoo models via its various fields (ir.model).
In addition to this, users can get information about the Odoo objects.
Introspection provides information about Odoo models fields. It allows adding custom fields without using Python code (ir.model.fields)
Furthermore, using these, users can create new fields at the Odoo site without the use of Pythons.
Go to Settings >> Technical >> Models
Users can view the read/create record schema.
Users can preview the field details in the feedback.
Do I have to install an extra library before installing this module?
Yes, You need to execute the requirements.txt file of this module using pip3.
How can I get Consumer Key and Consumer Secret in this module ?
You need to go to Users â Authentication, Here you need to create a new record after the creation of the record you will get Consumer Key and Consumer Secret.
How can I get Redirect URL for Oauth2?
Go to Users >> Authentication >> Oauth2 Access Token and Endpoint, Here to Authorize Redirect URL you need to add a URL and this URL will be used as Redirect URL for Oauth2.
Is Oauth2 Access Token permanent to use in request?
No, the Oauth2 access token will be expired within half an hour, then you need to regenerate the access token using the refresh token.
Does your module can perform request operations for custom models?
Yes, Our module also supports request operation for custom objects.
Does your module support multi-database filters?
No, Our module will not work on Multi-database filters.
Can I call a function which is declared?
Yes, You can call functions which are declared on a particular model. For Example: /restapi/1.0/object///
Till how much time do I get free support for this module from your company, once I purchase this app?
Our company will give free support for thirty days. One month free bug support period will be offered pertaining to any one server used, testing or live.
Is it possible for you to add on a few features in this module as per my company requirements?
Our company's dedicated team of experts will map your company's requirements, and will do customization accordingly. You can contact us using our company Email id: contact@synconics.com
- All the apps are to be purchased separately, for individual versions and individual edition.
- One month free bug support period will be offered pertaining to any one server used, testing or live.
- Synconics is not responsible for installation or updating of the module on any of your server.
- If an error appears in our app due to other custom modules installed in your system or if Odoo base source code is not updated on your system, to make it compatible with your source code, we'll charge you for our efforts to resolve those errors and make the module compatible with your source code.
- Please refer the document for configuration. If any support is needed for module configuration, installation, updating or any help is needed, it will be considered in paid support.
- Please note that you are not allowed to distribute or resell this module after purchase.
- This module is tested and working on Odoo vanilla with Ubuntu OS.
- Support services will be provided from Monday to Friday, 10:30 AM to 7 PM IST (Indian Standard Time).
- Support will not be provided during Indian public holidays or company holidays.
- Configuration
- Odoo Hosting
- Customisation
- Functional Training
- Technical Training
- Support & Maintenance
- Dedicated Developer
- Implementation
- Odoo Migration
- API Integration
connect on whatsapp.
Odoo REST API: Version 1.0 documentation
Our Odoo REST API Reference houses a lot of information, but doesn't always tell you how you should use it.
If you want to built apps and other integrations for the Odoo, this tutorial will walk you through what is required to authenticate and make basic API calls.
Get the module
The module restapi is available on Synconics App Store, Here are links for:
- Version 12.0 (Community & Enterprise)
- Version 13.0 (Community & Enterprise)
- Version 14.0 (Community & Enterprise)
- Version 15.0 (Community & Enterprise)
Installation
Install restapi module by following below steps:
- Unzip restapi module to custom addons directory
- Restart odoo server
- Activate Developer Mode from the Settings menu
- Navigate to the Apps menu
- Click on Update Apps List menu in left side bar
- Once apps list is updated, click on Apps menu from left / top side bar
- Search module restapi
- Click on Install button.
Getting Started
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module
Report comment
Any abuse of this reporting system will be penalizedThere are no ratings yet!
Bug Report - Non-compliance with RFC 7617 for Basic Authentication making the REST API incompatible with sender applications configurable via a user-friendly interface compliant with RFC 7617
We have encountered an incompatibility issue between the REST API and a sender application configurable via a user-friendly interface compliant with RFC 7617 for Basic Authentication.
When attempting to connect to the REST API using the "Authorization Basic" option, it requires configuring a username and password that will be base64 encoded according to RFC 7617. However, our sender application does not allow configuring a token that does not undergo base64 transformation/encoding.
To work around this issue, we attempted to use the "Authorization Bearer Token" option, but the REST API verifies authentication differently in the token configuration and rejects our authentication.
We believe this is due to non-compliance with RFC 7617 for Basic Authentication on the part of the REST API. Indeed, RFC 7617 specifies that the username and password must be base64 encoded and included in the "Authorization" header in the form "Basic {base64encoded_credentials}". The REST API does not seem to follow this specification, making the use of Basic Authentication incompatible with sender applications configurable via a user-friendly interface compliant with RFC 7617.
We kindly request that you correct this issue of non-compliance with RFC 7617 for Basic Authentication in the REST API to allow compatible use with sender applications configurable via a user-friendly interface compliant with RFC 7617.
Thank you in advance for your attention and help in resolving this issue.