- Receiving a list of all available skills
- Creating an empty transaction
- Adding a set of files to be processed in the transaction
- Starting the transaction
- Monitoring the transaction status
- Downloading source files and result files
Receiving a list of all available skills
To do so, send aGET request to the skills resource:
Run the following command:
The response will contain a JSON file that will look something like the following:
Creating an empty transaction
To do so, send the followingPOST request to the transactions resource:
Run the following command:
After an empty transaction has been successfully created, you will receive a response with the transaction identifier:
Adding a set of files to be processed in the transaction
The maximum number of files in a transaction is 1000.
Adding files directly to the transaction
To do so, send aPOST request to the transactions/<transaction-id>/files resource:
Run the following command:
As a result, you will receive a response with a list of added files and their identifiers. You can add as many files as you need by repeating this call multiple times.
Additional options for uploading files:
Adding files to a document
First, create a document by sending aPOST request to the transactions/<transaction-id>/documents resource:
As a result, you will receive a response with the document identifier.
Then add files to the document by sending a POST request to the transactions/<transaction-id>/documents/<document-id>/sourceFiles resource:
Starting the transaction
To start the transaction with the specified skill and files, send the followingPOST request to the transactions/<transaction-id>/start resource:
Monitoring the transaction status
To start monitoring the transaction status by using a loop with a short timeout (we do not recommend checking the status more often than once per second), send aGET request to the transactions/<transaction_id> resource with the transaction identifier in the request URI:
The response will look something like the following:
- If the value of the status key is set to:
- New — the transaction is created, but not currently in progress.
- Processing — the transaction has started, but the results are not ready yet.
- Processed — the transaction has been successfully completed, and you will be able to download the results.
- Failed — the transaction failed.
- Canceled — the transaction was canceled.
- The manualReviewLink key will contain a link to the web interface of the Manual Review client and a Vantage access token, if manual review is required. This link and token can be used to review and correct the classification and field extraction results of a particular transaction. Until the review is completed, the value of the status key will be set to Processing. The provided link is valid for 168 hours, after which a new link should be created and obtained for another period of 168 hours using the same method. See more in Integrating manual review.
Users authorized via this link are not able to view or modify any other documents or transactions.
Downloading source files and result files
After processing finishes, you can download two kinds of file:- Source files — the original files you uploaded, returned in their original binary format.
- Result files — the processing output: the extracted data, in JSON format by default (the output format is set by the skill).
Source files and result files use different endpoints and different file identifiers:
- Source file —
GET transactions/<transaction-id>/documents/<document-id>/sourceFiles/<file-id>/download. The file ID comes from theGET transactions/<transaction-id>/documentsresponse (sourceFiles[].id). - Result file —
GET transactions/<transaction-id>/files/<file-id>/download. The file ID comes from theresultFilesarray in the transaction status response (documents[].resultFiles[].fileId).
GET request to the transactions/<transaction-id>/documents resource and specify the transaction identifier:
As a result, you will receive a list of all the documents which have been created within this transaction. The response also contains the identifiers of these documents, which may be needed to request detailed information about specific documents.
Source files
To download a required source file, send aGET request to the transactions/<transaction-id>/documents/<document-id>/sourceFiles/<file-id>/download resource and specify the identifiers of the transaction, document, and file (from the last response):
Run the following command:
The response will contain the file in binary format. Repeat this step for all your source files.
Result files
To download a result file, send aGET request to the transactions/<transaction-id>/files/<file-id>/download resource and specify the transaction identifier and the result file’s fileId. Get the fileId from the resultFiles array returned when monitoring the transaction status (each entry has a fileId and a type, such as Json):
Run the following command:
