# Connecting to the Cloud Service

![](https://107752495-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mfn7c_RRw8NttzuzbZv%2F-Mfn7fipYXdV5KxisKMQ%2F-MfnAwMkQMuTrJOAfegF%2F%D0%9F%D0%BE%D0%B4%D0%BA%D0%BB%D1%8E%D1%87%D0%B5%D0%BD%D0%B8%D0%B5%20%D0%BA%20%D0%BE%D0%B1%D0%BB%D0%B0%D0%BA%D1%83.png?alt=media\&token=40afaefe-24ae-4aea-9931-537bbda8c1f0)

{% hint style="info" %}
Handl is a server-side solution. If you want to test it, use the [**web demo**](https://demo.handl.ai/). We do not use long-term data storage, all incoming files are transferred to the server via a secure protocol, processed in RAM and deleted immediately after the results are returned to the user.&#x20;
{% endhint %}

To set up the use of the cloud API you need to make a correct request for the necessary API-method. To do that, first familiarize yourself with the description of the service you need and its API-specification. After that proceed to making the required request:

## **Action sequence for the correct request**

1. Get your license key from our manager. If you don't have one, mail us:[ **sales@handl.ai**](mailto:hello@dbrain.io)
2. Find a picture of the test document. For testing purposes, you can use  the Japanese id, covid form or an invoice.&#x20;
3. Build a query using **Swagger U**I at [**latest.handl.ai/try**](https://latest.dbrain.io/try):
   1. Click on **Authorize** in the upper right corner of the page and enter your license key in any **Value** field;
   2. Select the API method you want. For example, if you need to recognize passport fields, select the **/recognize** method
   3. Click **Try it out**;
   4. Select the necessary values for the API request parameters. If a parameter is optional, you don't have to choose its value; it will be the default;
   5. Scroll down to the big blue button **Execute**, press **Select file** opposite to the image caption, in case of the passport from Wikipedia - **Pasport\_RF.jpg** file;
   6. press **Execute.**
4. In the curl field, you will get a correct curl-request. Copy it to the clipboard.
5. To check the curl query, use a console such as [**PowerShell**](https://github.com/PowerShell/PowerShell). To do this, go to the directory where the file you selected in step 3.5 is located. For example: cd C:\Downloads. Paste the curl query from the clipboard and execute it.

{% hint style="info" %}
The curl-request can be converted into the programming language you want by using online converters such as **curl.trillworks.com**
{% endhint %}

The request to the cloud must include the **API\_TOKEN** license key. Its transfer options are given below (the **END\_POINT** means a certain method such as **/recognize**).

```bash
# token in header, option №1
$ curl -siX POST \
    -H "Authorization: Token <API_TOKEN>" \
    -F "image=@document.jpg" \
    "https://latest.handl.ai/<END_POINT>"

# token in header, option №2
$ curl -siX POST \
    -H "Authorization: <API_TOKEN>" \
    -F "image=@document.jpg" \
    "https://latest.handl.ai/<END_POINT>"

# token in request
$ curl -siX POST \
    -F "image=@document.jpg" \
    "https://latest.handl.ai/<END_POINT>?token=<API_TOKEN>"

# token in cookies
$ curl -siX POST \
    -H "Cookie: token=<API_TOKEN>"
    -F "image=@document.jpg" \
    "https://latest.handl.ai/<END_POINT>"
```
