# Authentication

## Signature Request

Send a POST request to [`http://52.220.113.182:8000/`](http://52.220.113.182:8000/) by providing these arguments as `application/json` with request payload:

#### Sign In

```
{
    "email" : "email",
    "password" : "password"
}
```

You will get a response similar to this:

```
{
    "activated": {
        "id": 52,
        "name": "name",
        "username": "username",
        "company": "company",
        "email": "email",
        "status_aktif": 1,
        "uuid": "uuid"
    },
    "message": "success",
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2NDQzODM4NjEsImlzcyI6IjUyIn0.tAx9tAMfmPeLGaU0XZOlP8yhD9K4kLQX2--wUNqf_C8",
    "username": "username",
    "uuid": "uuid"
}
```

{% hint style="info" %}
You can use the token contained in the JSON response as an authentication key.
{% endhint %}

## Construct Authorization Key

After you get the signature response contains `token`, you can start to construct your authorization key with this format:

```
Authorization=Bearer {YOUR_TOKEN}
```

## Token for AI services

You can't use the AI service API if you haven't got a special token that is sent with the image or video data along with some supporting parameters. to get it you must first create a token.

Do POST request [http://52.220.113.182:8000/createtoken?uuid=](http://52.220.113.182:8000/createtoken?uuid=166b6b3b-81cb-4d0c-b2df-26c4546d2a01)"your uuid"

{% hint style="info" %}
Response will be in JSON form with token in it
{% endhint %}

```
{
    "message": "success",
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2NDQzODM4OTUsImlzcyI6IjUyIn0.KNU3IlK3qM6A-2fG9jF8retDOF6DTpSRCr3v39hFeW4"
}
```
