Skip to main content
A typical scenario for processing documents using a single API call (for creating a transaction, uploading a file, and starting a transaction) consists of the following steps:
  1. Receiving a list of all available skills
  2. Creating and starting transaction
  3. Monitoring the transaction status
  4. Downloading source files and result files
Each request to the server must include authentication information. For more information, see Authentication. Use this scenario if you only have one file that is less than 30 MB in size and you don’t need to edit images of the file.

Receiving a list of all available skills

To do so, send a GET request to the skills resource:
GET https://your-server/api/publicapi/v1/skills
Run the following command: For Windows:
curl -X GET "https://your-server/api/publicapi/v1/skills" \
-H "Authorization: Bearer token"
For Linux:
curl -X GET 'https://your-server/api/publicapi/v1/skills' \
-H 'Authorization: Bearer token'
As a result, you will receive information about all the skills added to the application instance.

Creating and starting a transaction

To do so, send a POST request to the transactions/launch resource:
POST https://your-server/api/publicapi/v1/transactions/launch
In the body of the request, specify the skillId parameter, which was returned by the previous API call, and send the file to be processed. An example request body may be as follows:
{
  "settings": {
    "skillId": "00000000-0000-0000-0000-000000000001"
  },
  "files": [
    {
      "file": "image content"
    }
  ]
}
Run the following command: For Windows:
curl -X POST "https://your-server/api/publicapi/v1/transactions/launch" \
-H "accept: */*" \
-H "Authorization: Bearer token" \
-H "Content-Type: multipart/form-data" \
-F "Model={
   \"settings\": {
     \"skillId\": \"00000000-0000-0000-0000-000000000001\"
   },
   \"files\": [
     {
     }
   ]
}" \
-F "Files=@testImage.tif;type=image/tiff"
For Linux:
curl -X POST 'https://your-server/api/publicapi/v1/transactions/launch' \
-H 'accept: */*' \
-H 'Authorization: Bearer token' \
-H 'Content-Type: multipart/form-data' \
-F 'Model={
   "settings": {
     "skillId": "00000000-0000-0000-0000-000000000001"
   },
   "files": [
     {
     }
   ]
}' \
-F 'Files=@testImage.tif;type=image/tiff'
As a result, you will receive a response containing the id of the created transaction.

Monitoring the transaction status

To do so, send a GET request to the transactions resource:
GET https://your-server/api/publicapi/v1/transactions/transaction-id
Run the following command: For Windows:
curl -X GET "https://your-server/api/publicapi/v1/transactions/transaction-id" \
-H "Authorization: Bearer token"
For Linux:
curl -X GET 'https://your-server/api/publicapi/v1/transactions/transaction-id' \
-H 'Authorization: Bearer token'
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.
If the transaction status is Processed or ProcessedWithWarnings, go to step 4.

Downloading source files and result files

To download the source file, send a GET request to the transactions/files/download resource, where you should specify the file ID, which was received in the previous request:
GET https://your-server/api/publicapi/v1/transactions/transaction-id/files/file-id/download
Run the following command: For Windows:
curl -X GET "https://your-server/api/publicapi/v1/transactions/transaction-id/files/file-id/download" \
-H "Authorization: Bearer token"
For Linux:
curl -X GET 'https://your-server/api/publicapi/v1/transactions/transaction-id/files/file-id/download' \
-H 'Authorization: Bearer token'