Asynchronous mode

By default, Handl works in synchronous mode. You send a file for classification or recognition, wait for a response and only then send the next file. This mode is convenient for a low flow of documents and for testing purposes. In other cases, we recommend using the asynchronous mode. To enable it, specify async=true in the request parameters.
# asynchronous request for passport recognition from passport.jpg file, cloud version:
$ curl -X POST \
"https://latest.handl.io/recognize?doc_type=passport_main&quality=75&dpi=300&auto_pdf_raw_images=true&pdf_raw_images=true&async=true&token=ваш_ключ_лицензии" \
-H "accept: application/json" \
-H "Content-Type: multipart/form-data" \
-F "[email protected];type=image/jpeg"As a response to an asynchronous request Handl will return this HTTP-header:
The structure of the HTTP-message body is as follows:
task_id must be specified for recognition or classification results, for example:
Possible responses to the results request
If task_id is found and classification or recognition is completed, the response code is 200.
If task_id is found, but the classification or recognition of the document is not yet complete, the response code is 202.
If task_id is not found, the response code is 404. Make sure you are requesting the correct task_id.
Last updated
Was this helpful?