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

# ユーザーキー トークン

## トークンのリクエスト

必要なアクセストークンを取得するには、以下にリクエストを送信します： `/user-key-token` エンドポイント。その際、HTTP リクエストボディ内で以下のパラメーターを `application/x-www-form-urlencoded` 形式（文字エンコーディングは UTF-8）で指定します。

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

以下の情報を含むレスポンスが返されます： `accessToken`,`expiresIn`、および `tokenType`.

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

{% hint style="info" %}
**アクセス** トークンは、以下のアクセスに使用されます： Epsilon Retail Media API。
{% endhint %}

## リフレッシュ トークン

アクセストークンの有効期限が切れると、キャンペーン API から無効なトークンエラーが返されます。この場合、以下の図に示すように、リフレッシュトークンを使用して以下の `/token` エンドポイントにリクエストを送信します：

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

通常、ユーザーが新しいアクセストークンを必要とするのは、前のトークンの有効期限が切れた場合、またはクレームに関連付けられたリソースへのアクセス権を取得または喪失した場合のみです。API へのリクエストごとに新しいアクセストークンを取得するためにエンドポイントを呼び出すのは、推奨されない実装です。


---

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