# 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"
}'
```


---

# 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://developer.casso.vn/v1/danh-sach-api/api-lay-acess-token.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.
