odoo/odoo#197801

Created by SM Learn, Julien Castiaux (juc)
Merged at 0afec0db8a19971c9581c6221939d583ceeaa5e8

Statuses:

Linked pull requests
label
odoo-dev:master-json2rpc-juc
head
bec61f25e364bb4ed453f7af8203f4ad3032eb90
merged
4 months ago by SM Learn, Julien Castiaux (juc)
odoo/odoo odoo/enterprise
master #197801 #80365

[IMP] web: /json/2/<model>/<method>

A RPC endpoint that supports API Key.

Request:

POST /json/2/res.partner/read HTTP/1.1
Host: &lt;yourcompany&gt;.odoo.com
Authorization: bearer &lt;api-key&gt;
Content-Type: application/json

{
    &#34;ids&#34;: [3, 4],
    &#34;kwargs&#34;: {
        &#34;fields&#34;: [&#34;name&#34;]
    },
    &#34;context&#34;: {}
}

Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

[
    {&#34;id&#34;: 3, &#34;name&#34;: &#34;Mitchell Admin&#34;},
    {&#34;id&#34;: 4, &#34;name&#34;: &#34;Public user&#34;}
]

Error responses use proper HTTP codes!

HTTP/1.1 422 UNPROCESSABLE ENTITY
Content-Type: application/json; charset=utf-8

&#34;got an unexpected keyword argument &#39;badparameter&#39;&#34;

task-4572591