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

# Xác thực

API dùng để lấy access token thông qua API KEY được cung cấp. AcessToken là chuỗi mã hóa chứa thông tin của doanh nghiệp, có thời gian hết hạn là 24 giờ

## Get AccessToken

<mark style="color:blue;">`GET`</mark> `[URL]/api/auth?apiKey=`

Lấy Access Token thông qua API KEY

#### Query Parameters

| Name   | Type   | Description                            |
| ------ | ------ | -------------------------------------- |
| apiKey | string | API key của doanh nghiệp được cung cấp |

#### Headers

| Name                                           | Type   | Description      |
| ---------------------------------------------- | ------ | ---------------- |
| Content-Type<mark style="color:red;">\*</mark> | string | application/json |

{% tabs %}
{% tab title="200 Khi yêu cầu API thành công" %}

```
{
    "status_code": 9999,
    "instance_id": "stg",
    "instance_name": "cloud-vihat-saas-sync-public-api-77689c7b9c",
    "payload": {
        "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9 ...",
        "access_type" : "normal",
        "token_type": "Bearer"
    },
    "key_enabled": false
}
```

{% endtab %}
{% endtabs %}

**Thông tin kết quả trả về payload**

| Tham số       | Mô tả                                                                                                                                                              |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| access\_token | Access token truy cập                                                                                                                                              |
| access\_type  | <p>Có 2 loại </p><ul><li><strong>normal</strong> : Doanh nghiệp người dùng cuối</li><li><strong>bussiness</strong> : Doanh nghiệp là đối tác của OMICALL</li></ul> |
| token\_type   | Bearer                                                                                                                                                             |
