Rest API
  • Odoo REST API: Version 1.0 documentation
  • Connection
    • Configuration
    • Demo
    • Logging In
      • How you can do
        • Odoo Version Information
        • Oauth1 Authentication
        • OAuth2 Authentication
        • Basic Authentication
  • Calling Methods
    • Check Access Rights
    • List Records
      • Pagination
    • Count Records
    • Read Records
      • Read Single Record
      • Read List Records
      • Read Filter Records
    • Listing Record Fields
    • Create Records
    • Update Records
      • Update Single Record
      • Update List Records
    • Delete Records
      • Delete Single Record
      • Delete List Records
  • Report Printing
    • Print Single Report
    • Print List Reports
  • Inspection and Introspection
    • ir.model
    • ir.model.fields
Powered by GitBook
On this page
  1. Calling Methods

List Records

PreviousCheck Access RightsNextPagination

Last updated 1 year ago

Records can be listed and filtered via . It takes a mandatory filter (possibly empty) and returns the database identifiers of all records matching the filter.

GET /restapi/1.0/object/{object_name}

Request:

GET /restapi/1.0/object/res.partner/search?domain=[('is_company','=',True),('customer','=',True)] HTTP/1.1
Host: {your_Odoo_server_url}

JSON Response:

HTTP/1.1 200 OK

{
  'Partner': [
      7, 18, 12, 10, 17, 19, 8, 31, 26, 16, 13, 20, 30, 22, 29, 15, 23, 28, 74
  ]
}

XML Response:

HTTP/1.1 200 OK

<res.partner type="list">
    <item type="int">7</item>
    <item type="int">18</item>
    <item type="int">12</item>
    <item type="int">10</item>
    <item type="int">17</item>
    <item type="int">19</item>
    <item type="int">8</item>
    <item type="int">31</item>
    <item type="int">26</item>
    <item type="int">16</item>
    <item type="int">13</item>
    <item type="int">20</item>
    <item type="int">30</item>
    <item type="int">22</item>
    <item type="int">29</item>
    <item type="int">15</item>
    <item type="int">23</item>
    <item type="int">28</item>
    <item type="int">74</item>
</res.partner>

Query Parameters:

  • offset – OPTIONAL. Number of results to ignore (default: none)

  • limit – OPTIONAL. Maximum number of records to return (default: all)

  • order – OPTIONAL. Sort string

  • count – OPTIONAL. if True, only counts and returns the number of matching records (default: False)

Headers and Status Codes
Description

Request Headers

Response Headers

Status Codes

domain – A . Use an empty list to match all records.

– the response content type depends on Accept header

– The OAuth protocol parameters to authenticate.

– this depends on Accept header of the request

– no error

– there’s no resource

– authentication failed

– if any error raise

search()
domain
search domain
Accept
Authorization
Content-Type
200 OK
404 Not Found
401 Unauthorized
403 Forbidden