Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
      • Get a Tailored Demo
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +32 2 290 34 90
    • Get a Tailored Demo
  • Pricing
  • Help
  1. APPS
  2. Extra Tools
  3. Odoo rest API v 16.0
  4. Sales Conditions FAQ

Odoo rest API

by Cybrosys Techno Solutions https://www.cybrosys.com
Odoo
v 16.0 Third Party 5197
Download for v 16.0 Deploy on Odoo.sh
Apps purchases are linked to your Odoo account, please sign in or sign up first.
Availability
Odoo Online
Odoo.sh
On Premise
Lines of code 287
Technical Name rest_api_odoo
LicenseLGPL-3
Websitehttps://www.cybrosys.com
Versions 16.0 17.0 18.0
You bought this module and need support? Click here!
Availability
Odoo Online
Odoo.sh
On Premise
Lines of code 287
Technical Name rest_api_odoo
LicenseLGPL-3
Websitehttps://www.cybrosys.com
Versions 16.0 17.0 18.0
Community
Enterprise

Odoo rest API

Explore This Module

Overview Learn more about this module
Features View features of this module
Screenshots View screenshots for this module

Overview

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

Features

Api key generation using database authentication.
Authentication using the generated api key.
Available in Odoo 16.0 Community and Enterprise.
Can create records for the models we want to access.
Choose specific fields for data fetching.
Choose specific methods like GET, POST etc.
Create and update records from database.
Delete records.

Screenshots

Installing and configuration

  • First of all, we have to add a new parameter in odoo conf. file.
  • server_wide_modules = web, base, rest_api_odoo
    - This will allow us to send request to server without selecting database first.
    - Incase if you have to uninstall the module , you have to remove this parameter.
    - Next we can install the module.
  • After installing the Rest api app we can see a new api key field in users.
  • - Next we have to generate the api-key for the current user.
  • You can import the postman collections provided in the app folder for authentication and interacting with database in various methods.

Authentication

  • Next you have to select the database and login.
  • We have attached Postman collections through which you can authenticate rest api.
  • First, extract the zip file. Then, you will obtain the JSON-format file, which you can directly import into POSTMAN.
  • The url format will be like this - http://cybrosys:8016/odoo_connect Replace 'cybrosys:8016' with your localhost port number.
  • You have to provide database name, username and password through the headers while sending request.
  • If the authentication is successful , an api key will be generated for the current user.
  • This key will be used when sending api requests to database.
  • The response will be like this - {"Status": "auth successful", "User": "Mitchell Admin", "api-key": "66c2ebab-d4dc-42f0-87d0-d1646e887569"}.

Create records in Rest api app

  • Once authenticated via the REST API, records can be created within the REST API application.
    Note: Only administrators have access to view the module.
  • Here we can choose the model, and also we can choose the http methods.
  • The api response will be based on these records.



Get Records

  • You can send GET request to retrieve data from the database.
  • The postman collection has been provided with app files for sending request from postman.
  • You have to provide username, password and api key through the header.
  • Model can be passed as argument as the technical name , and also if you want specific record you can provide the id as well.
  • The format for GET method will be like this - http://cybrosys:8016/send_request?model=res.partner&Id=10.
  • We can specify the fields inside the JSON data, and it will be like this - {"fields": ["name", "email"]}.
  • This is the format of api response - {"records": [{"id": 10, "email": "deco.addict82@example.com", "name": "Deco Addict"}]}.

Create Records

  • Using POST method , you can create new records in the database.
  • Just make sure you enabled POST method for the model record in rest api app , otherwise you will get 'method not allowed' message.
  • For creating record you have to provide the JSON data along with the model.
  • You can make use of the postman collection that we have added with app files.
  • The format for sending POST request will be like this - http://cybrosys:8016/send_request?model=res.partner.
  • This is the format for JSON data - { "fields" :["name", "phone"] , "values": {"name": "abc", "phone":"55962441552" } }.
  • Make sure the data entered in correct format otherwise you will get 'Invalid JSON data' message.
  • Response will be in this format - {"New resource": [{"id": 51, "name": "abc", "phone": "55962441552"}]}.

Update Records

  • Updation of records in the database can be done with PUT method.
  • You have to provide the model and also the id or the record that you want to update.
  • You can use the Postman collection that we have provided and , you will be always have to send request with your login credentials. Otherwise, it will be showing access denied.
  • The format for sending PUT request will be like this - http://cybrosys:8016/send_request?model=res.partner&Id=46.
  • Here too you have to provide the JSON data through which the updates will be done.
  • The response format will be like this - {"Updated resource": [{"id": 46, "email": "abc@example.com", "name": "Toni"}]}.

Delete Records

  • Database records can be deleted by sending DELETE method request.
  • For the deletion we have to provide the Model and the record id that we want to delete.
  • Make sure you have permission to delete files for the selected model in the rest api record.
  • The delete request format will be like this - http://cybrosys:8016/send_request?model=res.partner&Id=46.
  • The response after successful deletion will be - {"Resource deleted": [{"id": 46, "email": "abc@example.com", "name": "Toni"}]}.

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

Need Help?

Got questions or need help? Get in touch.

odoo@cybrosys.com

WhatsApp

Say hi to us on WhatsApp!

+91 86068 27707

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author, please use the developer contact information. They can usually be found in the description.
Please choose a rating from 1 to 5 for this module.
  • Ratings
  • Discuss
There are no ratings yet!
problem with access rights
by
jakub@go4it.click
on 12/3/24, 3:42 PM

Hi,

I had to alter code as the original request into ir.model looks like its without group of user who is logged in and as well as GET request. I had to either add access for read for everyone or alter search with sudo. Can you elaborate correct way how to set it up? 


Thanks

Re: problem with access rights
by
Cybrosys Technologies
on 12/10/24, 12:39 AM Author

The access-related issues have been resolved, and the updated module is now available for download.


thank you for your effort where is the postman collection?
by
heshamtatawy@gmail.com
on 3/14/24, 11:29 AM


Re: thank you for your effort where is the postman collection?
by
Cybrosys Technologies
on 3/16/24, 12:30 AM Author

Hi, Get the latest version. The collections can be found in a directory called 'Postman Collection'


Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with