> 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/ru/publichnyi-api-exoclick/api-manual-postman-examples.md).

# Примеры Postman

## Обзор

Это руководство содержит пошаговые инструкции по аутентификации и созданию кампаний через API ExoClick с использованием Postman. Все примеры указывают требуемый тип запроса, заголовки и формат тела для каждого конечного пункта.

## Аутентификация (вход)

Вы можете аутентифицироваться, используя учетные данные своей учетной записи или постоянный 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 (Профиль > 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`\
*(Замените `8140060` на фактический ID вашей кампании из Шага 3)*

**Заголовки:**

```
Authorization: Bearer YOUR_TOKEN
```

**Тело (form-data):**

| Ключ              | Тип   | Значение                |
| ----------------- | ----- | ----------------------- |
| `id_library_url`  | Текст | `6512406` *(из Шага 1)* |
| `id_library_file` | Текст | `6884966` *(из Шага 2)* |
| `active`          | Текст | `1`                     |

Все идентификаторы, возвращаемые на каждом шаге, необходимо сохранять и использовать в последующих запросах. Не забудьте заменить `YOUR_TOKEN`, пути к файлам и идентификаторы на ваши реальные значения.
{% 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/ru/publichnyi-api-exoclick/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.
