> 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/zh/exoclick-gong-gong-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
```

**请求体（原始 JSON）：**

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

{% endtab %}

{% tab title="使用 API 令牌登录" %}
如果您已在 ExoClick 仪表板中生成令牌（个人资料 > API 令牌），请使用此方式。

**请求类型：** `POST`\
**URL：** `https://api.exoclick.com/v2/login`

**请求头：**

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

**请求体（原始 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
```

**请求体（原始 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
```

**请求体（原始 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`\
*（替换 `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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.exoclick.com/api/zh/exoclick-gong-gong-api/api-manual-postman-examples.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
