# Connecting to the Cloud Service

![](/files/-MfnAwMkQMuTrJOAfegF)

{% 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>"
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.handl.ai/connecting-and-testing/connecting-to-the-cloud-service.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
