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

# Access Token

관리자에서 발급받은 key, secret을 통해 api를 요청할 수 있는 token을 발급

## Get Token

<mark style="color:green;">`POST`</mark> `https://uprism.io:30443/oauth/token`

OAuth2 인증 방식을 따라 토큰을 발급하는 API\
Client Credentails 방식을 이용하여 토큰을 발급합니다.<br>

#### Headers

| Name          | Type   | Description                               |
| ------------- | ------ | ----------------------------------------- |
| Authorization | string | "Basic " + base64(clientKey:clientSecret) |

#### Request Body

| Name        | Type   | Description         |
| ----------- | ------ | ------------------- |
| grant\_type | string | client\_credentials |

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

```javascript
{
    "access_token": "1a2b3c4d-5e6f-7g8h-9i0j-1k2l3m4n5o6p",
    "token_type": "bearer",
    "expires_in": 3599,
    "scope": "read write"
}
```

{% endtab %}

{% tab title="401 " %}

```javascript
{
    "timestamp": 1563946941375,
    "status": 401,
    "error": "Unauthorized",
    "message": "Bad credentials",
    "path": "/oauth/token"
}
```

{% endtab %}
{% endtabs %}
