Quickstart

This section helps you quickly get started with TheODXProxy by demonstrating a basic request to read data from the res.partner model using the read action.

Note: All requests to TheODXProxy are sent as POST requests with a standardized JSON body. This format unifies access to various Odoo actions in a predictable and structured way.

POST /api/odoo/execute
Content-Type: application/json
Header: x-proxy-api:your-api-key

πŸ“˜ Example: Read res.partner Records

This example demonstrates how to use the read action to retrieve specific fields from partner records in Odoo.

βœ… Request Body

{
"id": "read_res_partner_demo",
"action": "read",
"model_id": "res.partner",
"keyword": {
"limit": 10,
"fields": ["name", "email", "phone"],
"context": {
"allowed_company_ids": [1],
"default_company_id": 1,
"tz": "Asia/Jakarta"
}
},
"params": [
[1, 2, 3]
],
"odoo_instance": {
"url": "https://your-odoo-instance.com",
"user_id": 2,
"db": "your-database-name",
"api_key": "your-odoo-api-key"
}
}

πŸ“Œ Explanation

  • action: "read" β€” fetches specific fields from existing records.

  • model_id: "res.partner" β€” refers to the Odoo model.

  • keyword.fields: The fields you want to retrieve (name, email, phone).

  • params: A list of record IDs to read ([1, 2, 3]).

  • odoo_instance: Connection details to your Odoo server.

🟒 Sample Response

If there’s an error, the response will follow JSON-RPC 2.0 error format:

πŸ”΄ Sample Error Response

Last updated