Odoo 19's JSON-2 API: the page is read from the body
Goal Read the 250 contacts of a real Odoo 19 through its JSON-2 API, page by page, with no database opened.
Odoo 19 replaces XML-RPC and JSON-RPC, removed in Odoo 22, with POST /json/2/<model>/<method>. Every existing integration has to move, and Odoo Online does not open its database: the API is its only door. JSON-2 reads offset and limit from the JSON body only.
- body: the domain, fields and order Odoo expects
- param_binding: body writes offset and limit into the body
- three requests, 250 contacts, none twice
POST /json/2/res.partner/search_read HTTP/1.1 200 POST /json/2/res.partner/search_read HTTP/1.1 200 POST /json/2/res.partner/search_read HTTP/1.1 200
manifests/10-partners.yaml
apiVersion: connectors.lumnik.io/v1kind: Connectormetadata: name: scenario-odoo-json2-a connector_type: rest-generic scopes: [crm-a]spec: base_url: http://host.docker.internal:18072 auth: kind: bearer token_env: SCENARIO_ODOO_JSON2_A_KEY # an Odoo API key, Preferences → Account Security headers: - { name: X-Odoo-Database, value: scen } endpoints: - id: partners method: POST path: /json/2/res.partner/search_read body: # sent as JSON: JSON-2 reads its arguments from the body domain: [[ref, "=like", "LUM-%"]] fields: [name, ref, city, email] order: id pagination: kind: offset param_binding: body # offset and limit written into the body, page after page offset_param: offset limit_param: limit limit: 100 response_path: $ target: kind: hybrid table: connector.scenario_odoo_partners_a unique_key: $.id promote: - { name: partner_id, path: $.id, type: bigint } - { name: name, path: $.name, type: text } - { name: ref, path: $.ref, type: text } - { name: city, path: $.city, type: text } - { name: email, path: $.email, type: text }$ lm apply -f 10-partners.yaml
Applied connector "scenario-odoo-json2-a" — 1 endpoint
$ lm source rest test scenario-odoo-json2-a
ENDPOINT METHOD STATUS ITEMS VERDICT
partners POST 200 100 ok
$ lm connector run scenario-odoo-json2-a
run scheduled: b9261716-4cca-4b81-adfe-dd87617fc5a7
$ lm run get b9261716-4cca-4b81-adfe-dd87617fc5a7 --wait-evaluated
ID CONNECTOR ENDPOINT STATUS IN OUT SKIPPED DEAD-LETTERS STARTED ENDED EVALUATED
b9261716 scenario-odoo-json2-a partners Completed 250 250 0 0 2026-11-21 18:40 2026-11-21 18:40 yes- pre-flight
- POST 200 · 100 items · ok
- Odoo's log
- 3 × POST /json/2/res.partner/search_read 200
- run
- IN 250 · OUT 250 · DEAD-LETTERS 0
evidence: replay.log, 01-seed.txt, 02-preflight.txt, 03-run.json, 04-odoo-requests.txt · transform v1
Limits
- The API key is minted by Odoo's shell: a user creates it in Preferences, Account Security.
- No watermark yet: each run reads the domain whole.
- Odoo 18 and older have no JSON-2: read their PostgreSQL (odoo-product-name-json).
- Before icreated/lumnik#2123, offset and limit went into the URL, which Odoo ignores: every page answered everything.
- 250 synthetic contacts.
This scenario runs on lumnik Open, free and open source.
Try lumnik Open →