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

# Exchange for Access Token

Once you have obtained the authorization code, you need to convert it to a long-lived (30 days) access token.&#x20;

## Exchange Authorization Code for Access Token

<mark style="color:green;">`POST`</mark> `https://www.talque.com/oauth2/access-token`

Convert the short-lived authentication code into a long-lived access token. Note that the payload must be `application/x-www-urlencoded` encoded per the OAuth2 specs.

#### Request Body

| Name           | Type   | Description                                        |
| -------------- | ------ | -------------------------------------------------- |
| grant\_type    | string | This field should always be: "authorization\_code" |
| code           | string | The authorization code received in the first step  |
| client\_id     | string | Your API client ID                                 |
| client\_secret | string | Your API client secret                             |

{% tabs %}
{% tab title="200 A successful Access Token request will return a JSON object containing the access token and expiration time, for example:" %}

```javascript
{
    "access_token": "R7pLF7F4oqlWUNrDE9KZWU63eyrg9kSCi10rS0il00bw5ITPAeAJ3FLlDynlFQv0sNzjQjZh",
    "expires": 1542055758351,
}
```

{% endtab %}
{% endtabs %}
