> For the complete documentation index, see [llms.txt](https://docs.exoclick.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.exoclick.com/api/ja/exoclick-paburikku-api/api-manual-postman-examples.md).

# Postman の例

## 概要

このガイドでは、Postman を使用して ExoClick API 経由で認証し、キャンペーンを作成するための手順をステップごとに説明します。各例では、各エンドポイントに必要なリクエストタイプ、ヘッダー、ボディ形式を示しています。

## 認証（ログイン）

アカウントの認証情報または永続的な API トークンを使用して認証できます。どちらも、その後のすべてのリクエストで使用する一時的な Bearer トークンを返します。

{% tabs %}
{% tab title="ユーザー名とパスワードでログイン" %}
**リクエストタイプ:** `POST`\
**URL:** `https://api.exoclick.com/v2/login`

**ヘッダー:**

```
Content-Type: application/json
```

**本文（raw JSON）:**

```json
{
  "username": "YOUR_USERNAME",
  "password": "YOUR_PASSWORD"
}
```

{% endtab %}

{% tab title="API トークンでログイン" %}
ExoClick ダッシュボード（Profile > API Tokens）でトークンを生成した場合はこちらを使用してください。

**リクエストタイプ:** `POST`\
**URL:** `https://api.exoclick.com/v2/login`

**ヘッダー:**

```
Content-Type: application/json
```

**本文（raw JSON）:**

```json
{
  "api_token": "YOUR_API_TOKEN"
}
```

{% endtab %}
{% endtabs %}

## 300x250 バナーキャンペーン作成フロー

以下の手順を正確な順序で実行してください。最後の手順で JSON から Form-Data への切り替えに注意してください。

{% stepper %}
{% step %}

### ランディングページURLを作成（ライブラリ）

送信先URLを登録します。標準バナーには `id_library_url`.

**リクエストタイプ:** `POST`\
**URL:** `https://api.exoclick.com/v2/library/url`

**ヘッダー:**

```
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
```

**本文（raw JSON）:**

```json
{
  "url": "https://your-landing-page.com"
}
```

**結果:** 返された `"id"` を保存します（例： `6512406`).
{% endstep %}

{% step %}

### 画像をアップロード（ライブラリ）

クリエイティブアセットを登録します。画像は正確に 300x250 である必要があります。

**リクエストタイプ:** `POST`\
**URL:** `https://api.exoclick.com/v2/library/file`

**ヘッダー:**

```
Authorization: Bearer YOUR_TOKEN
```

**本文（form-data）:**

| キー     | 種類   | 値                  |
| ------ | ---- | ------------------ |
| `file` | ファイル | 画像ファイル（300x250）を選択 |
| `type` | テキスト | `image`            |

**結果:** 返された `"id"` を保存します（例： `6884966`).
{% endstep %}

{% step %}

### キャンペーンのひな形を作成

ターゲティング、予算、および `img_banner` テンプレートを設定します。

**リクエストタイプ:** `POST`\
**URL:** `https://api.exoclick.com/v2/campaigns`

**ヘッダー:**

```
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
```

**本文（raw JSON）:**

```json
{
  "name": "Banner 300x250 Production",
  "status": 0,
  "advertiser_ad_type": 0,
  "media_storage_template": "img_banner",
  "size": "300x250",
  "categories": {
    "type": "targeted",
    "elements": [97, 98, 99]
  },
  "countries": {
    "type": "targeted",
    "elements": [
      {
        "country": "USA",
        "regions": [0]
      }
    ]
  },
  "pricing": {
    "model": 4,
    "price": 300
  },
  "start_date": "2026-03-02",
  "daily_limit_type": 1,
  "max_daily_budget": 2000,
  "budget_delivery_mode": 1,
  "run_on_responsive_zones": 1
}
```

**結果:** 返された `"id"` を保存します（例： `8140060`).
{% endstep %}

{% step %}

### バリエーションを追加

URL（ステップ1）と画像（ステップ2）をキャンペーン（ステップ3）に紐づけます。

**リクエストタイプ:** `POST`\
**URL:** `https://api.exoclick.com/v2/campaigns/8140060/variation`\
\&#xNAN;*（置き換え `8140060` をステップ3の実際のキャンペーンIDに*

**ヘッダー:**

```
Authorization: Bearer YOUR_TOKEN
```

**本文（form-data）:**

| キー                | 種類   | 値                     |
| ----------------- | ---- | --------------------- |
| `id_library_url`  | テキスト | `6512406` *（ステップ1から）* |
| `id_library_file` | テキスト | `6884966` *（ステップ2から）* |
| `active`          | テキスト | `1`                   |

各ステップで返されたすべてのIDは保存し、後続のリクエストで使用する必要があります。忘れずに置き換えてください `YOUR_TOKEN`、ファイルパス、およびIDを実際の値に置き換えてください。
{% endstep %}
{% endstepper %}


---

# 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://docs.exoclick.com/api/ja/exoclick-paburikku-api/api-manual-postman-examples.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.
