> 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/sk/partner-api-authentication/user-key-authentication.md).

# Token používateľského kľúča

## Žiadosť o tokeny

Ak chcete získať požadovaný prístupový token, pošlite požiadavku na `/user-key-token` koncový bod pridaním nasledujúcich parametrov pomocou `application/x-www-form-urlencoded` formátu s kódovaním znakov UTF-8 v tele požiadavky HTTP.

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

Dostanete odpoveď s `accessToken`,`expiresIn`a `tokenType`.

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

{% hint style="info" %}
Váš **prístupový** token sa používa na prístup k Epsilon Retail Media API.
{% endhint %}

## Obnovovací token

Keď vášmu prístupovému tokenu vyprší platnosť, API pre kampane vám vráti chybu neplatného tokenu. V takom prípade pošlite požiadavku na `/token` koncový bod s vaším obnovovacím tokenom, ako je znázornené na diagrame nižšie:

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

Pravidelne bude používateľ potrebovať nový prístupový token iba vtedy, keď predchádzajúcemu vyprší platnosť, alebo keď získa či stratí prístup k zdrojom, ktoré sú spojené s jeho nárokmi. Volanie koncového bodu s cieľom získať nový prístupový token pri každej požiadavke na naše API sa považuje za zlú prax.


---

# 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/sk/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.
