# Token Endpoint

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

<table data-header-hidden><thead><tr><th width="140"></th><th></th></tr></thead><tbody><tr><td>Token URL</td><td><em>https://qa-login.switchmarket.se/oauth/token</em></td></tr><tr><td>Grant type</td><td><em>client_credentials</em></td></tr><tr><td>Client ID</td><td><a href="/pages/GwPoX0pLSEmemp1WqJL6#view-clients">How to get client ID?</a></td></tr><tr><td>Client secret</td><td><a href="/pages/GwPoX0pLSEmemp1WqJL6#view-clients">How to get client secret?</a></td></tr><tr><td>Audience</td><td><em>https://qa-api.switchmarket.se</em></td></tr></tbody></table>
{% endtab %}

{% tab title="Production" %}

<table data-header-hidden><thead><tr><th width="140"></th><th></th></tr></thead><tbody><tr><td>Token URL</td><td><em>https://login.switchmarket.se/oauth/token</em></td></tr><tr><td>Grant type</td><td>client_credentials</td></tr><tr><td>Client ID</td><td><a href="/pages/GwPoX0pLSEmemp1WqJL6#view-clients">How to get client ID?</a></td></tr><tr><td>Client secret</td><td><a href="/pages/GwPoX0pLSEmemp1WqJL6#view-clients">How to get client secret?</a></td></tr><tr><td>Audience</td><td><em>https://api.switchmarket.se</em></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

{% hint style="warning" %}
It is important that the fetched access token is cached by the client for the duration of its validity and reused for subsequent requests. The Switch Authorization Server imposes rate limits on the token endpoint which when reached will reject the requests to fetch an access token for a given time period.
{% endhint %}

{% hint style="danger" %}
Please ensure that the values you send for all parameters above to the Switch Authorization Server are correct without any additional new lines or other characters added *before* or *after* the actual value.
{% endhint %}


---

# 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.switchmarket.se/switch-api/authentication/token-endpoint.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.
