> For the complete documentation index, see [llms.txt](https://help.citrusad.com/retail-media-interface/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.citrusad.com/retail-media-interface/partner/cs/partner-api-authentication/user-key-authentication.md).

# Token uživatelského klíče

## Žádost o žetony

Chcete-li získat požadovaný přístupový žeton, odešlete požadavek na koncový bod `/user-key-token` koncový bod přidáním následujících parametrů pomocí `application/x-www-form-urlencoded` formátu s kódováním znaků UTF-8 v těle požadavku HTTP.

```http
POST https://auth.<env>.citrusad.com/v2/user-key-token
Content-Type: application/x-www-form-urlencoded
user_key=<USER_KEY>
```

Obdržíte odpověď s `accessToken`,`expiresIn`a `tokenType`.

```json
{
    "accessToken": "ACCESS_TOKEN",
    "expiresIn": 84000,
    "tokenType": "Bearer"
}
```

{% hint style="info" %}
Váš **přístupový** žeton se používá k přístupu k Epsilon Retail Media API.
{% endhint %}

## Obnovovací žeton

Při vypršení platnosti přístupového žetonu obdržíte z API pro kampaně chybu neplatného žetonu. V takovém případě odešlete požadavek na `/token` koncový bod s vaším obnovovacím žetonem, jak je znázorněno na diagramu níže:

<figure><img src="/files/NjdJjA3nlB9inj6yvtWS" alt="Authentication refresh flow.png" width="100%"><figcaption></figcaption></figure>

Uživatel obvykle potřebuje nový přístupový žeton pouze tehdy, když vyprší platnost předchozího, nebo když získá či ztratí přístup ke zdrojům, které jsou připojeny k jeho oprávněním. Volat koncový bod pro získání nového přístupového žetonu při každém požadavku na naše API je špatná praxe.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://help.citrusad.com/retail-media-interface/partner/cs/partner-api-authentication/user-key-authentication.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
