Wednesday, May 14, 2025
1 change · master
New functionality added to Odoo
This change adds a new JSON API endpoint that lets external systems call Odoo using API keys, making integrations simpler and more reliable. It also improves database selection through a request header and returns clearer HTTP error codes, helping partners diagnose issues faster.
Original PR description
A RPC endpoint that supports API Key.
Request:
```http
POST /json/2/res.partner/read HTTP/1.1
Host: <yourcompany>.odoo.com
Authorization: bearer <api-key>
Content-Type: application/json
{
"ids": [3, 4],
"kwargs": {
"fields": ["name"]
},
"context": {}
}
```
Response:
```http
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{"id": 3, "name": "Mitchell Admin"},
{"id": 4, "name": "Public user"}
]
```
Error responses use proper HTTP codes!
```http
HTTP/1.1 422 UNPROCESSABLE ENTITY
Content-Type: application/json; charset=utf-8
"got an unexpected keyword argument 'badparameter'"
```
task-4572591