- 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:
As a result, you will receive information about all the skills added to the application instance.
Creating an empty transaction
To do so, send the followingPOST request to the transactions resource:
Run the following command:
In the body of the request specify the skillId parameter, which was returned by the previous API call. As a result, you will receive a response containing the id of the created transaction.
Adding a set of files to be processed in the transaction
Important! The maximum number of files in a transaction is 1000. A set of files can be added in two ways: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:
As a result, you will receive a response containing the transaction status. Transaction processing may be in one of the following statuses:
New. The transaction was created but has not been queued for processing yet.Queued. The transaction is queued for processing.InProgress. The transaction is being processed.Processed. The transaction was successfully processed.ProcessedWithWarnings. The transaction was processed but warnings occurred.NotProcessed. The transaction was not processed due to an error.Deleted. The transaction was deleted by the user or automatically by the retention policy.
Processed or ProcessedWithWarnings, go to step 6.
Downloading source files
To request a list of documents with their identifiers, send aGET 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.
To request a list of files which were added to a specific document, send a GET request to the transactions/<transaction-id>/documents/<document-id> resource:
As a result, you will receive information about the document. The response also contains identifiers of files added to the document.
To download the source file, send a GET request to the transactions/<transaction-id>/files/<file-id>/download resource:
