> For the complete documentation index, see [llms.txt](https://developer.casso.vn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.casso.vn/v1/danh-sach-api/api-lay-acess-token.md).

# API lấy Acess-Token

## &#x20;Get access token

<mark style="color:green;">`POST`</mark> `https://oauth.casso.vn/v1/token`

&#x20;Endpoint này dùng để lấy access token.

#### Request Body

| Name | Type   | Description |
| ---- | ------ | ----------- |
| code | string | API Key     |

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

```
{
    "refresh_token": "Refresh token",
    "access_token": "Access token",
    "expires_in": "Số giây access token hết hạn, mặc định là 21600 = 6 tiếng"
}
```

{% endtab %}

{% tab title="401 " %}

```
{
    "error": 401,
    "message": "Unauthorized Access",
    "data": null
}
```

{% endtab %}
{% endtabs %}

```
curl --location --request POST 'http://oauth.casso.vn/v1/token' \
--header 'Content-Type: application/json' \
--data-raw '{
    "code": "API Key"
}'
```
