| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Lines of code | 2 |
| Technical Name |
mrm_rest_api_read |
| License | LGPL-3 |
Rest API All System Read
REST API Documentation
Logged-in session
## Authentication
'''URL
/web/session/authenticate
```json
{
"jsonrpc": "2.0",
"params": {
"db": "odoo",
"login": "",
"password": ""
}
}
## Current Session info
'''URL
/web/session/get_session_info
## Logout
'''URL
/web/session/destroy
Use Odoo API keys.
**Header**
```
Authorization: Bearer (API_KEY)
Content-Type: application/json
```
Odoo applies normal access rights and record rules of the authenticated user.
## Endpoints
Base URL:
```
/api/(slug)
```
### Health
- **GET** `/api/health` → `{ "status": "ok" }`
### List
- **GET** `/api/(slug)?domain=(py-list)&fields=a,b,c&limit=80&offset=0&order=create_date desc`
- **Response**
```json
{
"count": 2,
"total": 125,
"limit": 80,
"offset": 0,
"results": [ { /* record with M2O expanded */ }, ... ]
}
```
**Notes**
- `domain` is a Python-style list, e.g. `[("state", "=", "sale")]` URL-encoded.
- `fields` is optional; if omitted, all readable fields are returned.
### Retrieve
- **GET** `/api/(slug)/(id)
- **Response**: a single record dict with many2one expanded.
## Examples
### 1) List confirmed sale orders (id, name, partner)
```
GET /api/sale_order?domain=[("state","=","sale")]&fields=id,name,partner_id
Authorization: Bearer (API_KEY)
```
**Response**
```json
{
"count": 1,
"total": 1,
"limit": 80,
"offset": 0,
"results": [
{"id": 5, "name": "SO005", "partner_id": {"id": 12, "name": "Azure Interior"}}
]
}
## Error format
```json
{"error": "message"}
```
Please log in to comment on this module