26.58

v 8.0 v 9.0 v 10.0 v 11.0 v 12.0 Third Party 31
Availability
Odoo Online
Odoo.sh
On Premise
Technical Name odoo_rest_api
LicenseSee License tab
Versions 10.0 12.0 8.0 9.0 11.0
You bought this module and need support? Click here!
Availability
Odoo Online
Odoo.sh
On Premise
Technical Name odoo_rest_api
LicenseSee License tab
Versions 10.0 12.0 8.0 9.0 11.0

Odoo Rest API

This module adds full support for Rest API in Odoo

FEATURES:

  • User can create, update, search, delete any record via Rest API
  • All python methods inside Odoo can be called from Rest Api
  • Works with every Odoo model and custom modules
  • Send context via rest api (e.g. language)
  • Operations on multiple records with one request
  • Authentication with Odoo login and password
  • Permissions based on Odoo user permissions
  • No additional python modules or software required - works on default Odoo
  • Test server and support: support@gksoftware.pl
  • POSSIBLE REQUESTS:

  • GET: /rest/<model> - get records from selected model; parameters: fields, offset, limit, domain, sort
  • GET: /rest/<model>/<ids> - get selected records from selected model; parameters: fields
  • POST: /rest/<model> - create record in selected model
  • PUT: /rest/<model>/<ids> - update selected records in selected model
  • DELETE: /rest/<model>/<ids> - delete selected records from selected model
  • POST: /rest/<model>/<method> - run any method from selected model
  • POST: /rest/<model>/<method>/<ids> - run any method from selected model for selected records
  • EXAMPLES:

    [Example 1] - Get all users data - selected fields

    Request:
    curl -X GET -u admin:admin -H "Content-Type: text/html" http://localhost:8069/rest/res.users -d "{'fields': ['name', 'login']}"
    Response
    [
      {
        "id": 1,
        "login": "admin",
        "name": "Administrator"
      },
      {
        "id": 6,
        "login": "portal",
        "name": "Demo Portal User"
      },
      {
        "id": 5,
        "login": "demo",
        "name": "Demo User"
      },
      {
        "id": 7,
        "login": "support@gksoftware.pl",
        "name": "Grzegorz"
      }
    ]

    [Example 2] - Search users: name contains 'demo'

    Request:
    curl -X GET -u admin:admin -H "Content-Type: text/html" http://localhost:8069/rest/res.users -d "{'domain': [['name', 'ilike', 'demo']], 'fields': ['name']}"
    Response
    [
      {
        "id": 6,
        "name": "Demo Portal User"
      },
      {
        "id": 5,
        "name": "Demo User"
      }
    ]

    [Example 3] - Get partners - selected ids

    Request:
    curl -X GET -u admin:admin -H "Content-Type: text/html" http://localhost:8069/rest/res.partner/25,26 -d "{'fields': ['name']}"
    Response
    [
      {
        "id": 25,
        "name": "Chao Wang"
      },
      {
        "id": 26,
        "name": "David Simpson"
      }
    ]

    [Example 4] - Create record

    Request:
    curl -X POST -u admin:admin -H "Content-Type: text/html" http://localhost:8069/rest/res.partner -d "{'name': 'Created Partner'}"
    Response
    46

    [Example 5] - Update 3 records with one request

    Request:
    curl -X PUT -u admin:admin -H "Content-Type: text/html" http://localhost:8069/rest/res.partner/25,26,46 -d "{'name': 'New name'}"
    Response
    true

    [Example 6] - Delete selected records

    Request:
    curl -X DELETE -u admin:admin -H "Content-Type: text/html" http://localhost:8069/rest/res.partner/26,46
    Response
    true

    [Example 7] - Execute model method - confirm sale order

    Request:
    curl -X POST -u admin:admin -H "Content-Type: text/html" http://localhost:8069/rest/sale.order/action_confirm/3
    Response
    true
    Any questions?
    Want to test this module?
    Email me: support@gksoftware.pl
    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

    • 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 or have a question related to your purchase, please use the support page.