All requests to the API must contain an authorization header. To get the authorization header:
Concatenate the application ID and the token using a colon as a separator (find the application ID and the token on the Applications page in the ABBYY FlexiCapture Cloud web portal).
Encode the resulting string using any variant of Base64.
Add the authorization method followed by a space in front of the string from step 2.
Example
Application ID = Aladdin, token = OpenSesame
Concatenate the application ID and the token:
Aladdin:OpenSesame
Encode the string using any variant of Base64:
QWxhZGRpbjpPcGVuU2VzYW1l
Add the authorization method followed by a space in front of the string from step 2:
Basic QWxhZGRpbjpPcGVuU2VzYW1l
The resulting authorization header will appear as follows:
Upload a file to the server. You will get the file’s identifier and token in the response. The identifier and token will be used in all subsequent requests concerning this file.curl -X POST —header “Accept: application/json” —header “Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l” “https://api-{location-id}.flexicapture.com/v2/file” —form “file=@/path/to/file/Letter.tif”Supported location-ids: us: USA and Canada, au: Australia, eu: The European Union countries.
The project settings for document assembly will be ignored when uploading a file via REST API. A separate document will be created for each file.
After your document has been uploaded, start a task to begin the data extraction. You can specify multiple files in this request. The request may contain the following optional parameters: invoice region, verification type, and the export format for the results. The response will contain a task identifier.curl -X POST —header “Content-Type: application/json” —header “Accept: application/json” —header “Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l” -d ”{“properties”: {“region”: “US”,“export_format”: “Xls”,“verification_type”: “NoVerification”,},“files”: [{“id”: “5ea16ff21b777315586713bf”,“token”: “34FB84AA68684F0F2BF496045224EB6C436F596B”}]}” “https://api-{location-id}.flexicapture.com/v2/task/capture/invoices”Supported location-ids: us: USA and Canada, au: Australia, eu: The European Union countries.
Processing the task will take some time, so the extracted data will not be available immediately. You can check the task status using the identifier you have received when starting the task. Wait until the status changes to Done.curl -X GET —header “Accept: application/json” —header “Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l” “https://api-{location-id}.flexicapture.com/v2/task/5ea18adc220e0d1c58177c59”Supported location-ids: us: USA and Canada, au: Australia, eu: The European Union countries.