Skip to navigation

Scan Asynchronous Multiple Documents

View as Markdown

Scan a asynchronous document using the Invoice model in Staple to receive the document ID extracted. The Read operation executes asynchronously. The time for completion of the text extraction process depends on the volume of the text and the number of pages in the document. After the document finished scanning, you can get data extracted by document ID via https://api-gateway.staple.io/v1/documents/{docId}

The documents would be left in the queue specified for any further manipulation.

If you are looking to scan a file for a custom model you have developed, simply create a queue using that model and use the queue ID with this endpoint. It will extract data based on your queue instead of the invoice model.

Authentication

x-api-keystring
API key issued by Staple.
AuthorizationBearer
JWT obtained from the login endpoint.

Request

This endpoint expects a multipart form with multiple files.
filesfilesRequired

Files to scan. Send one files part per file.

qidstringRequired
ID of the queue to scan into. The queue's model decides which fields are extracted.
handwrittenstringOptional

Optional. A JSON array of booleans with one entry per file, in the same order as the files: true when that file contains handwriting, false when it does not. For example [false] for one file, or [false,true] for two files where only the second is handwritten. Leave it out to scan every file as not handwritten. The array length must equal the number of files, and values must be lowercase JSON (true, not True); otherwise the request returns an error.

Response

OK