> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Processing Documents with a Single API Call

> Process documents in ABBYY Vantage with one combined API call: list skills, create and start a transaction, monitor status, and download result files.

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](#receiving-a-list-of-all-available-skills)
2. [Creating and starting a transaction](#creating-and-starting-a-transaction)
3. [Monitoring the transaction status](#monitoring-the-transaction-status)
4. [Downloading source files and result files](#downloading-source-files-and-result-files)

Each request to the server must include authentication information. See [Authentication](/vantage/developer/authentication/authentication) for details.

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:

<CodeGroup>
  ```text US theme={null}
  GET https://vantage-us.abbyy.com/api/publicapi/v1/skills
  ```

  ```text EU theme={null}
  GET https://vantage-eu.abbyy.com/api/publicapi/v1/skills
  ```

  ```text AU theme={null}
  GET https://vantage-au.abbyy.com/api/publicapi/v1/skills
  ```
</CodeGroup>

Run the following command:

**For Windows:**

<CodeGroup>
  ```bash US theme={null}
  curl -X GET "https://vantage-us.abbyy.com/api/publicapi/v1/skills" \
  -H "Authorization: Bearer token"
  ```

  ```bash EU theme={null}
  curl -X GET "https://vantage-eu.abbyy.com/api/publicapi/v1/skills" \
  -H "Authorization: Bearer token"
  ```

  ```bash AU theme={null}
  curl -X GET "https://vantage-au.abbyy.com/api/publicapi/v1/skills" \
  -H "Authorization: Bearer token"
  ```
</CodeGroup>

**For Linux:**

<CodeGroup>
  ```bash US theme={null}
  curl -X GET 'https://vantage-us.abbyy.com/api/publicapi/v1/skills' \
  -H 'Authorization: Bearer token'
  ```

  ```bash EU theme={null}
  curl -X GET 'https://vantage-eu.abbyy.com/api/publicapi/v1/skills' \
  -H 'Authorization: Bearer token'
  ```

  ```bash AU theme={null}
  curl -X GET 'https://vantage-au.abbyy.com/api/publicapi/v1/skills' \
  -H 'Authorization: Bearer token'
  ```
</CodeGroup>

The response will contain a JSON file that will look something like the following:

**Response:**

```json theme={null}
[
   {
      "id": "Receipt",
      "name": "Receipt",
      "type": "Document"
   },
   {
      "id": "c4b26798-07cb-11eb-adc1-0242ac120002",
      "name": "NewClassifier",
      "type": "Classification"
   },
   {
      "id": "c4b26798-07cb-11eb-adc1-0242ac120002",
      "name": "Invoice",
      "type": "Document"
   }
]
```

Define the skill identifier you are going to use. Detailed descriptions of skills can be found in built-in skills.

### Creating and starting a transaction

To create and start a transaction to process an uploaded file with a specified skill, send the following `POST` request to the `transactions/launch?skillId=<skill-id>` resource:

<CodeGroup>
  ```text US theme={null}
  POST https://vantage-us.abbyy.com/api/publicapi/v1/transactions/launch?skillId=skill-id
  ```

  ```text EU theme={null}
  POST https://vantage-eu.abbyy.com/api/publicapi/v1/transactions/launch?skillId=skill-id
  ```

  ```text AU theme={null}
  POST https://vantage-au.abbyy.com/api/publicapi/v1/transactions/launch?skillId=skill-id
  ```
</CodeGroup>

This will create and immediately start a new transaction.

Run the following command:

**For Windows:**

<CodeGroup>
  ```bash US theme={null}
  curl -X POST "https://vantage-us.abbyy.com/api/publicapi/v1/transactions/launch?skillId=skill-id" \
  -H "accept: text/plain" \
  -H "Authorization: Bearer token" \
  -H "Content-Type: multipart/form-data" \
  -F "Files=@1page_invoiceUS_86.pdf;type=application/pdf"
  ```

  ```bash EU theme={null}
  curl -X POST "https://vantage-eu.abbyy.com/api/publicapi/v1/transactions/launch?skillId=skill-id" \
  -H "accept: text/plain" \
  -H "Authorization: Bearer token" \
  -H "Content-Type: multipart/form-data" \
  -F "Files=@1page_invoiceUS_86.pdf;type=application/pdf"
  ```

  ```bash AU theme={null}
  curl -X POST "https://vantage-au.abbyy.com/api/publicapi/v1/transactions/launch?skillId=skill-id" \
  -H "accept: text/plain" \
  -H "Authorization: Bearer token" \
  -H "Content-Type: multipart/form-data" \
  -F "Files=@1page_invoiceUS_86.pdf;type=application/pdf"
  ```
</CodeGroup>

**For Linux:**

<CodeGroup>
  ```bash US theme={null}
  curl -X POST 'https://vantage-us.abbyy.com/api/publicapi/v1/transactions/launch?skillId=skill-id' \
  -H 'accept: text/plain' \
  -H 'Authorization: Bearer token' \
  -H 'Content-Type: multipart/form-data' \
  -F 'Files=@1page_invoiceUS_86.pdf;type=application/pdf'
  ```

  ```bash EU theme={null}
  curl -X POST 'https://vantage-eu.abbyy.com/api/publicapi/v1/transactions/launch?skillId=skill-id' \
  -H 'accept: text/plain' \
  -H 'Authorization: Bearer token' \
  -H 'Content-Type: multipart/form-data' \
  -F 'Files=@1page_invoiceUS_86.pdf;type=application/pdf'
  ```

  ```bash AU theme={null}
  curl -X POST 'https://vantage-au.abbyy.com/api/publicapi/v1/transactions/launch?skillId=skill-id' \
  -H 'accept: text/plain' \
  -H 'Authorization: Bearer token' \
  -H 'Content-Type: multipart/form-data' \
  -F 'Files=@1page_invoiceUS_86.pdf;type=application/pdf'
  ```
</CodeGroup>

<Info>
  When uploading the file to Vantage, all of the following characters in the file name will be replaced with an underscore: `:/?#[]@!$&'()*+,;=\`. The changed file name will be displayed in both the Vantage API and Skill Monitor.
</Info>

### 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 a `GET` request to the `transactions/<transaction_id>` resource with the transaction identifier in the request URI:

<CodeGroup>
  ```text US theme={null}
  GET https://vantage-us.abbyy.com/api/publicapi/v1/transactions/transaction-id
  ```

  ```text EU theme={null}
  GET https://vantage-eu.abbyy.com/api/publicapi/v1/transactions/transaction-id
  ```

  ```text AU theme={null}
  GET https://vantage-au.abbyy.com/api/publicapi/v1/transactions/transaction-id
  ```
</CodeGroup>

Run the following command:

**For Windows:**

<CodeGroup>
  ```bash US theme={null}
  curl -X GET "https://vantage-us.abbyy.com/api/publicapi/v1/transactions/transaction-id" \
  -H "Authorization: Bearer token"
  ```

  ```bash EU theme={null}
  curl -X GET "https://vantage-eu.abbyy.com/api/publicapi/v1/transactions/transaction-id" \
  -H "Authorization: Bearer token"
  ```

  ```bash AU theme={null}
  curl -X GET "https://vantage-au.abbyy.com/api/publicapi/v1/transactions/transaction-id" \
  -H "Authorization: Bearer token"
  ```
</CodeGroup>

**For Linux:**

<CodeGroup>
  ```bash US theme={null}
  curl -X GET 'https://vantage-us.abbyy.com/api/publicapi/v1/transactions/transaction-id' \
  -H 'Authorization: Bearer token'
  ```

  ```bash EU theme={null}
  curl -X GET 'https://vantage-eu.abbyy.com/api/publicapi/v1/transactions/transaction-id' \
  -H 'Authorization: Bearer token'
  ```

  ```bash AU theme={null}
  curl -X GET 'https://vantage-au.abbyy.com/api/publicapi/v1/transactions/transaction-id' \
  -H 'Authorization: Bearer token'
  ```
</CodeGroup>

The response will look something like the following:

**Response:**

<CodeGroup>
  ```json US theme={null}
  {
     "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
     "status": "Processing", 
     "manualReviewLink": "https://vantage-us.abbyy.com/api/publicapi/v1/verify?documentIds=9838448d-72ae-4e9a-b071-2bb16f732e46",
     "sourceFiles": [
        {
           "id": "7b2eed6f-3fdd-43b9-a178-7211d0a8d5bb",
           "name": "Invoice07.JPG"
        }
     ]
  }
  ```

  ```json EU theme={null}
  {
     "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
     "status": "Processing", 
     "manualReviewLink": "https://vantage-eu.abbyy.com/api/publicapi/v1/verify?documentIds=9838448d-72ae-4e9a-b071-2bb16f732e46",
     "sourceFiles": [
        {
           "id": "7b2eed6f-3fdd-43b9-a178-7211d0a8d5bb",
           "name": "Invoice07.JPG"
        }
     ]
  }
  ```

  ```json AU theme={null}
  {
     "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
     "status": "Processing", 
     "manualReviewLink": "https://vantage-au.abbyy.com/api/publicapi/v1/verify?documentIds=9838448d-72ae-4e9a-b071-2bb16f732e46",
     "sourceFiles": [
        {
           "id": "7b2eed6f-3fdd-43b9-a178-7211d0a8d5bb",
           "name": "Invoice07.JPG"
        }
     ]
  }
  ```
</CodeGroup>

In the response:

* If the value of the `status` key is set to `Processing`, the results are not ready yet. Once the status of the transaction changes to `Processed`, you will be able to download the results.
* 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](/vantage/developer/integrating-manual-review).

<Info>
  Users authorized via this link are not able to view or modify any other documents or transactions.
</Info>

For a Document skill, the response will now look something like the following:

**Response:**

```json theme={null}
{
   "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
   "status": "Processed",
   "documents": [
      {
         "id": "9838448d-72ae-4e9a-b071-2bb16f732e46",
         "resultFiles": [
            {
               "fileId": "3a3e6245-48e1-489a-9fef-a10b5ba28515",
               "type": "Json"
            }
         ],
         "businessRulesErrors": []
      }
   ],
   "sourceFiles": [
      {
         "id": "7b2eed6f-3fdd-43b9-a178-7211d0a8d5bb",
         "name": "Invoice07.jpg"
      }
   ]
}
```

In the `documents` array, each document has a `resultFiles` array. Use this array to get the `fileId` values. The format of the output files is defined by the skill that you use. Currently, all skills return the extracted fields in [JSON format](/vantage/developer/output/json/json-output).

For a Classification skill, the response received after the documents have been processed will look something like the following:

**Response:**

```json theme={null}
{
   "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
   "status": "Processed",
   "documents": [
      {
         "id": "9838448d-72ae-4e9a-b071-2bb16f732e46",
         "classification": {
            "isResultClassConfident": true,
            "resultClass": {
               "id": "8f2a51d4-6c0b-4e2a-9d3e-5b7c1a9f0e64",
               "name": "Invoice"
            },
            "classConfidences": [
               {
                  "classId": "8f2a51d4-6c0b-4e2a-9d3e-5b7c1a9f0e64",
                  "className": "Invoice",
                  "confidence": 89
               },
               {
                  "classId": "2c9d7e01-4b3a-4f6c-8a15-d0e6f2b8c473",
                  "className": "PurchaseOrder",
                  "confidence": 32
               }
            ]
         }
      }
   ],
   "sourceFiles": [
      {
         "id": "7b2eed6f-3fdd-43b9-a178-7211d0a8d5bb",
         "name": "Invoice07.jpg"
      }
   ]
}
```

Extract the class of the document from the `resultClass.name` key and check the confidence of each probable class in the `confidence` keys (an integer from 0 to 100).

For a Process skill, the response may contain all or some of the information that is returned for Document and Classification skills, depending on the stages available in the Process skill.

### 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](/vantage/developer/output/json/json-output) by default (the output format is set by the skill).

<Info>
  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 the `GET transactions/<transaction-id>/documents` response (`sourceFiles[].id`).
  * **Result file** — `GET transactions/<transaction-id>/files/<file-id>/download`. The file ID comes from the `resultFiles` array in the [transaction status](#monitoring-the-transaction-status) response (`documents[].resultFiles[].fileId`).
</Info>

To request a list of documents with their identifiers, send a `GET` request to the `transactions/<transaction-id>/documents` resource and specify the transaction identifier:

<CodeGroup>
  ```text US theme={null}
  GET https://vantage-us.abbyy.com/api/publicapi/v1/transactions/transaction-id/documents
  ```

  ```text EU theme={null}
  GET https://vantage-eu.abbyy.com/api/publicapi/v1/transactions/transaction-id/documents
  ```

  ```text AU theme={null}
  GET https://vantage-au.abbyy.com/api/publicapi/v1/transactions/transaction-id/documents
  ```
</CodeGroup>

Run the following command:

**For Windows:**

<CodeGroup>
  ```bash US theme={null}
  curl -X GET "https://vantage-us.abbyy.com/api/publicapi/v1/transactions/transaction-id/documents" \
  -H "Authorization: Bearer token"
  ```

  ```bash EU theme={null}
  curl -X GET "https://vantage-eu.abbyy.com/api/publicapi/v1/transactions/transaction-id/documents" \
  -H "Authorization: Bearer token"
  ```

  ```bash AU theme={null}
  curl -X GET "https://vantage-au.abbyy.com/api/publicapi/v1/transactions/transaction-id/documents" \
  -H "Authorization: Bearer token"
  ```
</CodeGroup>

**For Linux:**

<CodeGroup>
  ```bash US theme={null}
  curl -X GET 'https://vantage-us.abbyy.com/api/publicapi/v1/transactions/transaction-id/documents' \
  -H 'Authorization: Bearer token'
  ```

  ```bash EU theme={null}
  curl -X GET 'https://vantage-eu.abbyy.com/api/publicapi/v1/transactions/transaction-id/documents' \
  -H 'Authorization: Bearer token'
  ```

  ```bash AU theme={null}
  curl -X GET 'https://vantage-au.abbyy.com/api/publicapi/v1/transactions/transaction-id/documents' \
  -H 'Authorization: Bearer token'
  ```
</CodeGroup>

#### Source files

To download a required source file, send a `GET` 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):

<CodeGroup>
  ```text US theme={null}
  GET https://vantage-us.abbyy.com/api/publicapi/v1/transactions/transaction-id/documents/document-id/sourceFiles/file-id/download
  ```

  ```text EU theme={null}
  GET https://vantage-eu.abbyy.com/api/publicapi/v1/transactions/transaction-id/documents/document-id/sourceFiles/file-id/download
  ```

  ```text AU theme={null}
  GET https://vantage-au.abbyy.com/api/publicapi/v1/transactions/transaction-id/documents/document-id/sourceFiles/file-id/download
  ```
</CodeGroup>

Run the following command:

**For Windows:**

<CodeGroup>
  ```bash US theme={null}
  curl -X GET "https://vantage-us.abbyy.com/api/publicapi/v1/transactions/transaction-id/documents/document-id/sourceFiles/file-id/download" \
  -H "Authorization: Bearer token"
  ```

  ```bash EU theme={null}
  curl -X GET "https://vantage-eu.abbyy.com/api/publicapi/v1/transactions/transaction-id/documents/document-id/sourceFiles/file-id/download" \
  -H "Authorization: Bearer token"
  ```

  ```bash AU theme={null}
  curl -X GET "https://vantage-au.abbyy.com/api/publicapi/v1/transactions/transaction-id/documents/document-id/sourceFiles/file-id/download" \
  -H "Authorization: Bearer token"
  ```
</CodeGroup>

**For Linux:**

<CodeGroup>
  ```bash US theme={null}
  curl -X GET 'https://vantage-us.abbyy.com/api/publicapi/v1/transactions/transaction-id/documents/document-id/sourceFiles/file-id/download' \
  -H 'Authorization: Bearer token'
  ```

  ```bash EU theme={null}
  curl -X GET 'https://vantage-eu.abbyy.com/api/publicapi/v1/transactions/transaction-id/documents/document-id/sourceFiles/file-id/download' \
  -H 'Authorization: Bearer token'
  ```

  ```bash AU theme={null}
  curl -X GET 'https://vantage-au.abbyy.com/api/publicapi/v1/transactions/transaction-id/documents/document-id/sourceFiles/file-id/download' \
  -H 'Authorization: Bearer token'
  ```
</CodeGroup>

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 a `GET` 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](#monitoring-the-transaction-status) (each entry has a `fileId` and a `type`, such as `Json`):

<CodeGroup>
  ```text US theme={null}
  GET https://vantage-us.abbyy.com/api/publicapi/v1/transactions/transaction-id/files/file-id/download
  ```

  ```text EU theme={null}
  GET https://vantage-eu.abbyy.com/api/publicapi/v1/transactions/transaction-id/files/file-id/download
  ```

  ```text AU theme={null}
  GET https://vantage-au.abbyy.com/api/publicapi/v1/transactions/transaction-id/files/file-id/download
  ```
</CodeGroup>

Run the following command:

**For Windows:**

<CodeGroup>
  ```bash US theme={null}
  curl -X GET "https://vantage-us.abbyy.com/api/publicapi/v1/transactions/transaction-id/files/file-id/download" \
  -H "Authorization: Bearer token"
  ```

  ```bash EU theme={null}
  curl -X GET "https://vantage-eu.abbyy.com/api/publicapi/v1/transactions/transaction-id/files/file-id/download" \
  -H "Authorization: Bearer token"
  ```

  ```bash AU theme={null}
  curl -X GET "https://vantage-au.abbyy.com/api/publicapi/v1/transactions/transaction-id/files/file-id/download" \
  -H "Authorization: Bearer token"
  ```
</CodeGroup>

**For Linux:**

<CodeGroup>
  ```bash US theme={null}
  curl -X GET 'https://vantage-us.abbyy.com/api/publicapi/v1/transactions/transaction-id/files/file-id/download' \
  -H 'Authorization: Bearer token'
  ```

  ```bash EU theme={null}
  curl -X GET 'https://vantage-eu.abbyy.com/api/publicapi/v1/transactions/transaction-id/files/file-id/download' \
  -H 'Authorization: Bearer token'
  ```

  ```bash AU theme={null}
  curl -X GET 'https://vantage-au.abbyy.com/api/publicapi/v1/transactions/transaction-id/files/file-id/download' \
  -H 'Authorization: Bearer token'
  ```
</CodeGroup>
