ORESTAPI record name_search
Search for records of a model by display_name
Request
Sample request
curl -v -i -k -H "Authorization: Bearer vWRXap0Iyojs8hxNO9IQKeWRLFpyhGfU" -X GET -d "model=res.partner" -d "name=Web" https://example.com/orestapi/record/name_search
Item | Description | Notes |
---|---|---|
endpoint | /orestapi/record/name_search | |
type | GET | |
Header | ||
Authorization | Bearer access_token | |
Params | ||
model | model name (eg: res.partner, crm.lead, account.invoice, etc)
| |
name | the string to search for
| |
offset | which chunk of the result should be returned
| eg: if offset is 40, than results between 41-60 will be returned |
order | how to order the results
| follows Odoo domain conventions, so:
|
limit | how many results should be returned
|
Response
Sample response
[{"header": {{"model": "res.partner", "action_id": 121, "menu_id": 91, "count": 4, "offset": 0, "limit": 20}}, {"data": [{"id": 13, "name": "Camptocamp"}, {"id": 31, "name": "Camptocamp, Ayaan Agarwal"}, {"id": 37, "name": "Camptocamp, Benjamin Flores"}, {"id": 30, "name": "Camptocamp, Phillipp Miller"}]}]
Parent | Key | Value Type | Description | Notes |
---|---|---|---|---|
header | parent element with generic info about the resultset | |||
model | model | model name | ||
action_id | integer | action id to be used for URL generation | An action (ir.actions.act_window) id for the model, integer, eg: 45 | |
menu_id | integer | menu id to be used for URL generation | A menu (ir.ui.menu) id for the model, integer, eg: 312 | |
count | integer | count of total results | ||
offset | integer | number of results to ignore (default: 0) | ||
limit | integer | maximum number of records to return (default: 20) | ||
data | parent element for the list of records | |||
id | integer | the id of the record (eg: 1, 413, 4356, etc) | The id of the record in the database, eg: 1, 413, 4356, etc | |
display_name | string | the display_name of the record (eg: John Doe, etc) | The value of the record's display_name as defined by the model's name_get function, eg: "INVOICE/2018/314", "John Doe", "Confluence DC sales opportunity for BigCompany" |