[REM] extract_api: remove documentation of get_result_batch

For security reasons, we had to drop the support of those routes.

X-original-commit: 24c7b2506e
Part-of: odoo/documentation#6004
This commit is contained in:
Louis Baudoux 2023-10-03 18:35:14 +02:00
parent 2955009bfc
commit 0404cce0ba
2 changed files with 18 additions and 55 deletions

View File

@ -235,12 +235,8 @@ Routes
------
- /api/extract/invoice/1/get_result
- /api/extract/invoice/1/get_result_batch
- /api/extract/expense/1/get_result
- /api/extract/expense/1/get_result_batch
- /api/extract/applicant/1/get_result
- /api/extract/applicant/1/get_result_batch
- |ss| /api/extract/invoice/1/get_results |se| (deprecated)
- |ss| /iap/invoice_extract/get_result |se| (deprecated)
- |ss| /iap/expense_extract/get_result |se| (deprecated)
@ -262,10 +258,10 @@ Request
``version`` (required)
|SAME_AS_PARSE|
``documents_uuids`` (required, replaces ``documents_ids``)
The list of ``document_id`` for which you want to get the current parsing status.
``documents_ids`` (deprecated)
The list of ``document_id`` for which you want to get the current parsing status.
``documents_uuid`` (required, replaces ``documents_id``)
The ``document_uuid`` for which you want to get the current parsing status.
``documents_id`` (deprecated)
The ``document_id`` for which you want to get the current parsing status.
.. code-block:: js
@ -274,18 +270,12 @@ Request
"method": "call",
"params": {
"version": int,
// "documents_ids": [], // deprecated
"documents_uuids": [],
// "documents_id": int, // deprecated
"documents_uuid": int,
},
"id": string,
}
.. note::
The code snippet shows the request to the ``/api/extract/invoice/1/get_result_batch`` route.
You can use the endpoint ``/api/extract/invoice/1/get_result`` to get the result of a single
document. In that case, you don't need to provide a list of ``document_uuids`` but a single
``document_uuid``.
Response
--------
@ -324,48 +314,21 @@ are the name of the field and the value is the value of the field.
"jsonrpc": "2.0",
"id": string,
"result": {
"document_id_1": {
"status": string,
"status_code": int, // deprecated
"status_msg": string,
"results": [
{
"full_text_annotation": string,
"feature_1_name": feature_1_result,
"feature_2_name": feature_2_result,
...
},
"status": string,
"status_code": int, // deprecated
"status_msg": string,
"results": [
{
"full_text_annotation": string,
"feature_1_name": feature_1_result,
"feature_2_name": feature_2_result,
...
]
},
"document_id_2": {
"status": string,
"status_code": int, // deprecated
"status_msg": string,
"results": [
{
"full_text_annotation": string,
"feature_1_name": feature_1_result,
"feature_2_name": feature_2_result,
...
},
...
]
},
...
},
...
]
}
}
.. note::
The example shows the response from the ``/api/extract/invoice/1/get_result_batch`` route.
When using the ``/api/extract/invoice/1/get_result`` route (note the singularity), the response
will be the value of the key associated to the invoice.
.. warning::
Result keys are strings despite the fact that the ``document_ids`` given in the request body are
integers.
Common fields
~~~~~~~~~~~~~

View File

@ -6,7 +6,7 @@ import time
import requests
account_token = "integration_token" # Use your token
domain_name = "https://iap-extract.odoo.com"
domain_name = "https://extract.api.odoo.com/"
path_to_pdf = "/path/to/your/pdf"
doc_type = "invoice" # invoice, expense or applicant