Skip to content

/xmlrpc and /jsonrpc are getting deprecated in Odoo 19.0 #101

@Julien00859

Description

@Julien00859

Hello friends at the OCA 👋

We (Odoo SA) plan on deprecating both the /xmlrpc and /jsonrpc endpoints in 19.0 for removal in saas-19.1 (20.0). The /json/2 endpoint (landed in 18.4) should act as replacement.

The new endpoint works as follow:

POST /json/2/<model>/<method> HTTP/1.1
Content-Type: application/json
Authorization: Bearer <api-key>
X-Odoo-Database: <dbname>

{
    "ids": [],
    "context": {},
    "kwarg1": value1,
    "kwarg2": value2,
    ...
}
HTTP/1.1 <sensible status code> <sensible phrase>
Content-Type: application/json

<json>

Mandatory:

  • (url) model
  • (url) method
  • (header) Authorization, using a API key that must be generated via the user's profile.

Optional:

  • (header) X-Odoo-Database, is determined from the hostname, or odoo-bin -d, when missing.
  • (request) ids, is an empty list by default
  • (request) context: is an empty dict by default

The response typically will be 200 OK with a Content-Type: application/json and the result of method immediately serialized as JSON. There's no longer any wrapping, {"result": {...}} and {"error": {...}} are gone.

In case of error, the response typically will be a 4xx/5xx status code, with a Content-Type: application/json, and the error message as a json-string in the body, example:

HTTP/1.1 422 Unprocessable Entity
Content-Type: application/json

"missing a required argument: 'domain'"

Note that there are some errors that can occur too early in our http stack and that we cannot serialize as json. For those the http status is sensitive too (a 4xx/5xx error) but the Content-Type is text/html.


We are reaching for you because we believe that most users are using this repository to communicate with Odoo. We believe you guys are very knowledgeable about the external API and the challenges using it involves. We would like to use this issue as a forum, to work together and make it the least painful to the users.

On our side we plan on updating the documentation, and communicate heavily during the OXP. I would very much like be able to say "if you are using the OdooRPC module from the OCA, you are covered.".

The endpoint has been merged in saas-18.4, and is considered stable-ish. The time window before 19.0 is closing rapidly but we still are in a position to change the controller (a bit) to accommodate for a better transition.

But one thing is pretty sure: we want to rely more on api-keys, and less on user/password pairs. We think it is gonna be the main pain-point for users, we assume it.

Sorry for the short notice, we agreed on the deprecation schedule with Fabien and Antony last Wednesday, one week ago. Their original plan was to entirely remove /xmlrpc and /jsonrpc in 19.0, we negotiated the endpoints to be deprecated in 19.0, and only removed in saas-19.1 (upcoming 20.0).

For the Odoo Framework teams
Julien (juc)

cc @rco-odoo @kmagusiak (krma) @PiaCOS (elco) @BastienFafchamps (bafa)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions