Availability |
Odoo Online
Odoo.sh
On Premise
|
Lines of code | 278 |
Technical Name |
rest_api_odoo |
License | LGPL-3 |
Website | https://www.cybrosys.com |
Versions | 16.0 17.0 18.0 |
Availability |
Odoo Online
Odoo.sh
On Premise
|
Lines of code | 278 |
Technical Name |
rest_api_odoo |
License | LGPL-3 |
Website | https://www.cybrosys.com |
Versions | 16.0 17.0 18.0 |

Odoo rest API
The odoo Rest API module allow us to connect to database with the help of GET ,POST ,PUT and DELETE request.

Key Highlights
Api Key Generation
This module Api key generation using database authentication.
Create Records
Can create records for the models we want to access.
Methods
This module Choose specific methods like GET, POST etc.
Create & Updates
Create and update records from database.
Delete
This module Choose DELETE method to delete records.

Step 1: Add a New Parameter in the Odoo.conf File
Before installing the module, Add
"server_wide_modules = web, base,
rest_api_odoo" to odoo.conf file. This
configuration enables the server to handle
requests without requiring database
selection. Once this is done, you can
proceed to
install the module.
Note: If you need to uninstall
the module, ensure you remove this parameter
from the configuration file.

Step 2: Locate the Postman collections in the provided app folder.
In the extracted module folder, locate the Postman collections file in JSON format.

Step 3: Open Postman and click the Import button.

Step 4: Select the JSON file from the module folder to import the collection.

Imported collections.

Step 5:Open Authentication.

Step 6: Update the Base URL, db (Database Name), login (Database Username) and password (Database Password) under Headers.

Step 7: Click Send.

If authentication is successful, an API key will be generated for the current user.

API Key in the User's Form View
To find the generated API Key for the current user, navigate to Settings > Users & Companies > Users, open the user's form view, and go to the API tab. The API Key will be displayed there.

Step 8: Create Rest API Records.
Navigate to Rest API in Rest API module and create new record. Select the model and the HTTP methods. The chosen methods will determine the allowed actions on the records, and the API response will reflect the changes made.

Step 9: Getting Records via REST API
Open Get records api collection in postman
and add the db, login, password, api-key in
the headers. Pass the model
(e.g., product.template) in the URL to
retrieve records for that model.
Note:
Make sure that GET method is enabled for product.template model in Rest API record.

Step 10: Specify the fields you want to retrieve in the JSON data under Body section and click Send.

The retrieved records.

Step 11: Get a specific record.
To retrieve a specific record, pass the ID in the URL (e.g., http://localhost:8027/send_request?model=product.template&Id=28) and click Send.

Retrieved record.

Step 12: Creating Records via POST Method
Open Create Records from Rest API Collection. Add db, api-key, login and password under Headers. Update the Base Url.

Step 13: Provide the JSON data under the Body section and specify the model in the URL. Click Send.
Note: Make sure that POST method is enabled for the selected model in Rest API record.

Created Record.

Step 14: Update Records Using PUT.
Open Update Records from Rest API Collection. Add db, api-key, login and password under Headers. Update the Base Url. Note: Make sure that PUT method is enabled for the selected model in Rest API record.

Step 15: Provide the JSON data under the Body section and specify the model in the URL. Click Send.

Response after record update.

Step 16: Delete Records Using DELETE.
Open Delete Records from Rest API Collection. Add db, api-key, login and password under Headers. Update the Base Url. Add the model and the id of the record to delete and click Send. Note: Make sure that DELETE method is enabled for the selected model in Rest API record.

Response after deleting the record.
-
We can create records in the rest api app.
-
We can send GET request to retrieve data from the database.
-
Update of records in the database can be done with PUT method.
-
Database records can be deleted by sending DELETE method request.
Initial Commit for Odoo rest API.
Related Products
Our Services

Odoo Customization

Odoo Implementation

Odoo Support

Hire Odoo Developer

Odoo Integration

Odoo Migration

Odoo Consultancy

Odoo Implementation

Odoo Licensing Consultancy
Our Industries

Trading
Easily procure and sell your products

POS
Easy configuration and convivial experience

Education
A platform for educational management

Manufacturing
Plan, track and schedule your operations

E-commerce & Website
Mobile friendly, awe-inspiring product pages

Service Management
Keep track of services and invoice

Restaurant
Run your bar or restaurant methodically

Hotel Management
An all-inclusive hotel management application
Support
Got questions or need help? Get in touch.
Say hi to us on WhatsApp!
Please log in to comment on this module
Report comment
Any abuse of this reporting system will be penalizedThere are no ratings yet!
Its good and simple to use!
But why we need to include the username and password inside the the request params although we've already have an API key?
there was some documentation attached before now none
is there any basic documentation for this module? any information on how to use would be great
Re: there was some documentation attached before now none
Basic documentation has been included within the index file.
Hi, im installed module Rest Api odoo but i can't see API key, Plesase Help me !
Re: Hi, im installed module Rest Api odoo but i can't see API key, Plesase Help me !
First of all add a new parameter in odoo conf. file.server_wide_modules = web, base, rest_api_odoo As mentiond in the app index.
After installing the Rest api app we can see a new api key field in users.
You can import the postman collections provided in the App folder for Api key generation using database authentication.
Hi,
I need to get date fields, such as the "change_date" or "date_order". They're blocked from receiving, I understand?
Re:
Hello, We have updated the app. Please get the latest version.