> For the complete documentation index, see [llms.txt](https://docs.roote.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roote.ai/api/authentification.md).

# Auth 🔐

You need to obtain a token before you can query our API.

### 1) Service registration

You need to register on developers.roote.io to use the list of services in this documentation.

{% content-ref url="/pages/-LXeep-zVIpHDAlimVZI" %}
[Broken mention](broken://pages/-LXeep-zVIpHDAlimVZI)
{% endcontent-ref %}

Once on the login window, fill in the **form on the left** to create an account.

![](https://4280107080-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LWcpc200vmiMyVBkIxP%2F-LfvgjxG4uYrdtKRfPb2%2F-Lfv5IaEKyxqiqxnLsfN%2FCapture%20d%E2%80%99e%CC%81cran%202019-05-27%20a%CC%80%2023.00.48.png?alt=media\&token=1abad342-8edd-40f1-8f74-b84711ddfe77)

### 2) Check your e-mail

After validating the form, a verification e-mail is sent to your mailbox.&#x20;

**It is necessary to validate your address before you can connect to the interface.**&#x20;

To validate your address, simply click on the link in the e-mail.&#x20;

You can now connect to devs.roote.ai

### 3) Create token

On the "Account" page, a blue button allows you to generate a token.

![](https://4280107080-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LWcpc200vmiMyVBkIxP%2F-LfvgjxG4uYrdtKRfPb2%2F-Lfv7sXlbz3DIBmjKNdG%2FCapture%20d%E2%80%99e%CC%81cran%202019-05-27%20a%CC%80%2023.11.34.png?alt=media\&token=9c154266-0a9f-4496-98fe-907ebb9a58e5)

{% hint style="danger" %}
"**Regenerate token**" **deletes** the active token, so you'll need to replace it in your databases.
{% endhint %}

## Using the token in queries

<mark style="color:blue;">`GET`</mark> `https://devs.roote.ai/api/realtime/:coords/:service?token=:token`

Replace the :**toke**n parameter with the active token of the developers.roote.io account

#### Path Parameters

| Name                                       | Type   | Description                                                 |
| ------------------------------------------ | ------ | ----------------------------------------------------------- |
| :coords<mark style="color:red;">\*</mark>  | string | <p>Latitude,Longitude of location<br>44.83301,-0.570184</p> |
| :service<mark style="color:red;">\*</mark> | string | REALTIME MODE                                               |

#### Query Parameters

| Name                                     | Type   | Description                       |
| ---------------------------------------- | ------ | --------------------------------- |
| :token<mark style="color:red;">\*</mark> | string | Active account token api.roote.ai |

{% tabs %}
{% tab title="200 Success call" %}

```javascript
[
    {
    "id": 625,
    "name": "Lionel",
    "lat": 44.834918,
    "lng": -0.568368,
    "battery": 88,
    "distance": 256
    },
    {
    "id": 693,
    "name": "Laurence",
    "lat": 44.835482,
    "lng": -0.568165,
    "battery": 86,
    "distance": 318
    }
]
```

{% endtab %}

{% tab title="400 Fail call" %}

```
Unauthorized: Invalid token
```

{% endtab %}
{% endtabs %}
