Overview

Кампании и контакты в API

Кампании#

GET/v2/campaigns

Список кампаний клиента.

Authorization
Authorizationstring

Sent as the Authorization header. Your key is used only by your browser for this request — it is never sent to Docsbook or stored.

POST/v2/campaigns

Создать кампанию. Тело запроса — JSON.

Authorization
Authorizationstring

Sent as the Authorization header. Your key is used only by your browser for this request — it is never sent to Docsbook or stored.

GET/v2/campaigns/{campaign_id}

Карточка кампании.

Authorization
Authorizationstring

Sent as the Authorization header. Your key is used only by your browser for this request — it is never sent to Docsbook or stored.

Path
campaign_idstringrequired

UUID кампании

POST/v2/campaigns/{campaign_id}/update

Изменить параметры кампании. Тело запроса — JSON.

Authorization
Authorizationstring

Sent as the Authorization header. Your key is used only by your browser for this request — it is never sent to Docsbook or stored.

Path
campaign_idstringrequired

UUID кампании

DELETE/v2/campaigns/{campaign_id}

Удалить кампанию вместе с её контактами и пулом сообщений.

Authorization
Authorizationstring

Sent as the Authorization header. Your key is used only by your browser for this request — it is never sent to Docsbook or stored.

Path
campaign_idstringrequired

UUID кампании

Аккаунты кампании#

POST/v2/campaigns/{campaign_id}/accounts

Привязать аккаунты к кампании: с них пойдут исходящие. Тело запроса — JSON.

Authorization
Authorizationstring

Sent as the Authorization header. Your key is used only by your browser for this request — it is never sent to Docsbook or stored.

Path
campaign_idstringrequired

UUID кампании

DELETE/v2/campaigns/{campaign_id}/accounts

Отвязать аккаунты от кампании. Тело запроса — JSON.

Authorization
Authorizationstring

Sent as the Authorization header. Your key is used only by your browser for this request — it is never sent to Docsbook or stored.

Path
campaign_idstringrequired

UUID кампании

Контакты#

Контакты кампании загружаются файлом и выгружаются в том же формате. Параметр format принимает только csv или xlsx, по умолчанию csv.

POST/v2/campaigns/{campaign_id}/contacts/upload

Загрузить базу контактов файлом. Тело запроса — multipart/form-data с полем file.

Authorization
Authorizationstring

Sent as the Authorization header. Your key is used only by your browser for this request — it is never sent to Docsbook or stored.

Path
campaign_idstringrequired

UUID кампании

Body
formatstring

csv или xlsx, по умолчанию csv

GET/v2/campaigns/{campaign_id}/contacts

Список контактов кампании.

Authorization
Authorizationstring

Sent as the Authorization header. Your key is used only by your browser for this request — it is never sent to Docsbook or stored.

Path
campaign_idstringrequired

UUID кампании

GET/v2/campaigns/{campaign_id}/contacts/stats

Сводка по контактам кампании.

Authorization
Authorizationstring

Sent as the Authorization header. Your key is used only by your browser for this request — it is never sent to Docsbook or stored.

Path
campaign_idstringrequired

UUID кампании

GET/v2/campaigns/{campaign_id}/contacts/export

Выгрузить контакты кампании файлом.

Authorization
Authorizationstring

Sent as the Authorization header. Your key is used only by your browser for this request — it is never sent to Docsbook or stored.

Path
campaign_idstringrequired

UUID кампании

Query
formatstring

csv или xlsx, по умолчанию csv

DELETE/v2/campaigns/{campaign_id}/contacts

Очистить базу контактов кампании.

Authorization
Authorizationstring

Sent as the Authorization header. Your key is used only by your browser for this request — it is never sent to Docsbook or stored.

Path
campaign_idstringrequired

UUID кампании

Пул сообщений#

Пул хранит варианты первичного сообщения. NN Agent берёт из него текст для очередного контакта, поэтому одинаковый текст не уходит всей базе подряд.

GET/v2/campaigns/{campaign_id}/message-pool

Список вариантов первого сообщения кампании.

Authorization
Authorizationstring

Sent as the Authorization header. Your key is used only by your browser for this request — it is never sent to Docsbook or stored.

Path
campaign_idstringrequired

UUID кампании

POST/v2/campaigns/{campaign_id}/message-pool

Добавить вариант сообщения в пул. Тело запроса — JSON.

Authorization
Authorizationstring

Sent as the Authorization header. Your key is used only by your browser for this request — it is never sent to Docsbook or stored.

Path
campaign_idstringrequired

UUID кампании

DELETE/v2/campaigns/{campaign_id}/message-pool/{message_id}

Удалить один вариант из пула.

Authorization
Authorizationstring

Sent as the Authorization header. Your key is used only by your browser for this request — it is never sent to Docsbook or stored.

Path
campaign_idstringrequired

UUID кампании

message_idstringrequired

UUID варианта сообщения

Дальше#

Updated

Кампании и контакты в API — NN Agent