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.

Last updated

Was this helpful?