Update Document
This endpoint allows you to update a single document with one or two parameters within the Xtracta App. These parameters are mainly designed to allow you to track which documents have been downloaded by your application to ensure processed documents are not picked up for re-downloading.
POST Parameters
| Parameter | Required | Value | Description |
|---|---|---|---|
api_key | {key} | An API key that has access to the resource you want to query for. | |
document_id | {integer} | The ID of a specific document you want information for. | |
new_workflow_id | {integer} | The ID of a specific workflow that you would like to reassign the document to. | |
api_download_status | active, archived | Define what status the document is in. Usually once you have downloaded the document, you would use the update document method to set it to archived. Thus when running this query you would usually set this parameter to active. | |
document_status | indexing, qa, reject, output, re-extract, re-ocr, complete reprocess, learning | Shift the document to a different status. This will override any validations set in the Xtracta App workflow for that document. | |
reason | {unicode} | Attach an arbitrary rejection reason to the document. Useful if you run pre-import validation which has requirements that the Xtracta App validation system does not support – you can move the document into rejection status and alert the user to what they need to fix. | |
free_form | {unicode} | Allows you to add any value to the field you want. This could be used for your own tracking purposes. | |
delete | {integer} | null – no value, 0 – restore document, 1 – delete document | |
field_data | {xml} | Data can be passed to a field using this parameter, for example you could pass data to a specific field in order to utilise the "custom classification" method. Before passing a custom classification please contact one of our support technicians for assistance. | |
validation | {integer} | Enable the validations to run for this document once submitted. | |
learning | {integer} | Enable the learning for this document. This flag should be used with field_data parameter. | |
user_email | {unicode} | This optional field can be used to record the email address of the user uploading the document. | |
user_id | {integer} | This optional field can be used to record the user ID of the user uploading the document. |
User email and ID
- If a value is passed for the user_email that does not exist as a current user, a new user record will be created.
- If the user_id option is passed, the user ID must be a valid value.
If both are passed, user_email will take precedence.
Document Status Override: Using document_status parameter will override workflow validations. Use validation=1 to re-enable validations after status change.
Example of field_data for above case
<?xml version="1.0" encoding="UTF-8"?>
<documents_response>
<status>200</status>
<message>The request has been successfully processed</message>
</documents_response>
Sample Request
POST https://api-app.xtracta.com/v1/documents/update HTTP/1.1 api_key=123&document_id=456789&api_download_status=archived
Sample Response
<?xml version="1.0" encoding="UTF-8"?> <documents_response> <status>200</status> <message>The request has been successfully processed</message> </documents_response>
Schema Definition
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:simpleType name="ConfidenceType">
<xs:union>
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="100"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value=""/>
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
<xs:element name="documents_response">
<xs:complexType>
<xs:sequence>
<xs:element name="status" type="xs:integer"/>
<xs:element name="message" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Archiving Note: When a document is archived via the API, the archival is specific to the API key used. If you have multiple API keys, the document can have a status of "active" with one API key and "archived" with others.