How to Upload Documents from Your Mobile Device Using the REST API

You can add a mobile device upload feature for documents to your application/web page. Images can either be captured using a camera or uploaded from the gallery of your mobile device. The uploaded document will be processed using ABBYY Vantage skills. The mobile device upload feature can be integrated into the following:

  • native Android and iOS applications,
  • mobile web applications,
  • desktop applications.

For a list of system requirements for mobile devices and web browsers, see the Uploading Documents from Your Mobile Device section of the Quick Start guide.

Note: Integration with applications is only possible via REST API. For more information about using REST API, see the Swagger documentation.

To get the mobile device document upload interface for ABBYY Vantage, you need a link that can be obtained by doing the following:

  1. Undergo authentication. For more information, see Authentication.
    Note: Each HTTP request to ABBYY Vantage should have a header containing an authentication token that is used by the service to identify users in the system.
  2. View the list of available skills and find the ID of the skill that you need to use to process the document.
    To do so, send a GET request to the Skills resource:

GET https://vantage-eu.abbyy.com/api/publicapi/v1/skills for users in Western Europe,
GET https://vantage-us.abbyy.com/api/publicapi/v1/skills for users in North America, and

GET https://vantage-au.abbyy.com/api/publicapi/v1/skills for users in Australia.

Run the following command:

For users in Western Europe:

curl -X GET "https://vantage-eu.abbyy.com/api/publicapi/v1/skills"
          -H "Authorization: Bearer token"
          
          

For users in North America:

curl -X GET "https://vantage-us.abbyy.com/api/publicapi/v1/skills"
          -H "Authorization: Bearer token"
          
          

For users in Australia:

curl -X GET "https://vantage-au.abbyy.com/api/publicapi/v1/skills"
          -H "Authorization: Bearer token"
        
  1. Create a transaction for the selected skill.
    Send a POST request to the Transactions resource:

POST https://vantage-eu.abbyy.com/api/publicapi/v1/transactions for users in Western Europe,

POST https://vantage-us.abbyy.com/api/publicapi/v1/transactions for users in North America, and

POST https://vantage-au.abbyy.com/api/publicapi/v1/transactions for users in Australia.

Run the following command:

For users in Western Europe:

curl -X POST "https://vantage-eu.abbyy.com/api/publicapi/v1/transactions"
          -H "Authorization: Bearer token" \
-H "Content-Type: application/json" \
-d "{\"skillId\":\"123\"}"
          
          

For users in North America:

curl -X POST "https://vantage-us.abbyy.com/api/publicapi/v1/transactions"
          -H "Authorization: Bearer token" \
-H "Content-Type: application/json" \
-d "{\"skillId\":\"123\"}"
          
          

For users in Australia:

curl -X POST "https://vantage-au.abbyy.com/api/publicapi/v1/transactions"
          -H "Authorization: Bearer token" \
-H "Content-Type: application/json" \
-d "{\"skillId\":\"123\"}"
        

skillId contains the identifier of the skill obtained in step 2.

You can also specify an optional parameter "generateMobileInputLink: true" to receive a link that allows you to open mobile input, upload documents to a particular transaction, and start the transaction. The link also contains a Vantage access token. To upload documents, either take photos of the document pages using the camera app of the device or upload them from the gallery. The provided link is valid for 30 minutes, after which a new link should be created and obtained for another period of 30 minutes using using either this method or method described in step 4.
Note: If you want to use QR codes or buttons for uploading files when integrating specific features into your website, we recommend that these QR codes and buttons also create a transaction and/or refresh the token once 30 minutes have expired. Otherwise, file uploads will fail once 30 minutes have passed.

Note: If you received a link in step 3, skip step 4.

  1. Get a mobile input link.
    Send a POST request to the Transactions resource:

POST https://vantage-eu.abbyy.com/api/publicapi/v1/transactions/transaction-id/mobileInputLink for users in Western Europe,

POST https://vantage-us.abbyy.com/api/publicapi/v1/transactions/transaction-id​/mobileInputLink for users in North America, and

POST https://vantage-au.abbyy.com/api/publicapi/v1/transactions/transaction-id​/mobileInputLink for users in Australia.

Run the following command:

For users in Western Europe:

curl -X POST "https://vantage-eu.abbyy.com/api/publicapi/v1/transactions/transaction-id​/mobileInputLink"
-H "Authorization: Bearer token" \
-H "Content-Type: application/json" \
-d "generateMobileInputLink: true"
          
          

For users in North America:

curl -X POST "https://vantage-us.abbyy.com/api/publicapi/v1/transactions/transaction-id​/mobileInputLink"
-H "Authorization: Bearer token" \
-H "Content-Type: application/json" \
-d "generateMobileInputLink: true"
          
          

For users in Australia:

curl -X POST "https://vantage-au.abbyy.com/api/publicapi/v1/transactions/transaction-id​/mobileInputLink"
-H "Authorization: Bearer token" \
-H "Content-Type: application/json" \
-d "generateMobileInputLink: true"
        

Opening the link on a mobile device allows you to upload documents to ABBYY Vantage using the instant application or web browser on your mobile device. You can either take photos of the document pages using the camera app of their device or upload them from the gallery.

Steps for uploading documents from a mobile device

Note: Only one document can be uploaded as part of a single transaction. If you want to upload specific pages or several multi-page documents at once, create a new transaction for each document.

Tracking document processing and downloading results

You can track the status of a transaction by sending a GET request to the Transactions resource:

GET https://vantage-eu.abbyy.com/api/publicapi/v1/transactions/transaction-id for users in Western Europe,

GET https://vantage-us.abbyy.com/api/publicapi/v1/transactions/transaction-id for users in North America, and

GET https://vantage-au.abbyy.com/api/publicapi/v1/transactions/transaction-id for users in Australia.

Run the following command:

For users in Western Europe:

curl -X GET https://vantage-eu.abbyy.com/api/publicapi/v1/transactions/transaction-id
          -H "Authorization: Bearer token"
          

For users in North America:

curl -X GET https://vantage-us.abbyy.com/api/publicapi/v1/transactions/transaction-id
          -H "Authorization: Bearer token"
          

For users in Australia:

curl -X GET https://vantage-au.abbyy.com/api/publicapi/v1/transactions/transaction-id 
          -H "Authorization: Bearer token"
        

Sample command results

The status key can have one of the following values:

  • Processing means that the document is currently being processed.
  • Processed means that processing has completed and the results can be downloaded.

To download a file containing processing results, send a GET request to the Transactions resource and specify the identifiers of your transaction and document file:

GET https://vantage-eu.abbyy.com/api/publicapi/v1/transactions/transaction-id/files/file-id/download for users in Western Europe,

GET https://vantage-us.abbyy.com/api/publicapi/v1/transactions/transaction-id/files/file-id/download for users in North America, and

GET https://vantage-au.abbyy.com/api/publicapi/v1/transactions/transaction-id/files/file-id/download for users in Australia.

Note: The file identifier can be found in the sourceFiles property in the results for the transaction status request.

Run the following command:

For users in Western Europe:

curl -X GET "https://vantage-eu.abbyy.com/api/publicapi/v1/transactions/transaction-id/files/file-id/download"
-H "Authorization: Bearer token"
          
          

For users in North America:

curl -X GET "https://vantage-us.abbyy.com/api/publicapi/v1/transactions/transaction-id/files/file-id/download"
-H "Authorization: Bearer token"
          
          

For users in Australia:

curl -X GET "https://vantage-au.abbyy.com/api/publicapi/v1/transactions/transaction-id/files/file-id/download"
-H "Authorization: Bearer token"
        

The command results will contain the document processing results in JSON format.

Note: If you want to download the results in PDF format, enable the corresponding option in the Output activity. To configure output formats, select the Output activity and click Settings in the Exported Data section in the Actions pane.

06.09.2022 16:21:49

Usage of Cookies. In order to optimize the website functionality and improve your online experience ABBYY uses cookies. You agree to the usage of cookies when you continue using this site. Further details can be found in our Privacy Notice.