Аккаунты в API и сессии авторизации
Все запросы требуют bearer-токен, см. Авторизацию.
Сессии авторизации#
/v2/accounts/auth-sessionsОткрыть сессию авторизации по номеру телефона. Возвращает идентификатор сессии, к которому дальше привязываются код и пароль. Тело запроса — JSON.
Sent as the Authorization header. Your key is used only by your browser for this request — it is never sent to Docsbook or stored.
/v2/accounts/auth-sessions/qrОткрыть сессию авторизации по QR-коду — альтернатива коду из сообщения. Тело запроса — JSON.
Sent as the Authorization header. Your key is used only by your browser for this request — it is never sent to Docsbook or stored.
/v2/accounts/auth-sessions/{auth_id}Состояние сессии: ждёт код, ждёт пароль, завершена, отклонена. Опрашивайте эту операцию между шагами подключения.
Sent as the Authorization header. Your key is used only by your browser for this request — it is never sent to Docsbook or stored.
UUID сессии авторизации
/v2/accounts/auth-sessions/{auth_id}/codeПередать код подтверждения, который мессенджер прислал на номер. Тело запроса — JSON.
Sent as the Authorization header. Your key is used only by your browser for this request — it is never sent to Docsbook or stored.
UUID сессии авторизации
/v2/accounts/auth-sessions/{auth_id}/passwordПередать облачный пароль, если у аккаунта включена двухфакторная защита. Тело запроса — JSON.
Sent as the Authorization header. Your key is used only by your browser for this request — it is never sent to Docsbook or stored.
UUID сессии авторизации
/v2/accounts/auth-sessions/{auth_id}/resend-codeЗапросить повторную отправку кода подтверждения.
Sent as the Authorization header. Your key is used only by your browser for this request — it is never sent to Docsbook or stored.
UUID сессии авторизации
/v2/accounts/auth-sessions/{auth_id}Прервать незавершённую сессию авторизации.
Sent as the Authorization header. Your key is used only by your browser for this request — it is never sent to Docsbook or stored.
UUID сессии авторизации
Пошаговый разбор этой последовательности — Подключить аккаунт по API.
Аккаунты#
/v2/accountsСписок подключённых аккаунтов клиента. Клиент определяется по токену.
Sent as the Authorization header. Your key is used only by your browser for this request — it is never sent to Docsbook or stored.
/v2/accounts/{account_id}Карточка одного аккаунта.
Sent as the Authorization header. Your key is used only by your browser for this request — it is never sent to Docsbook or stored.
UUID аккаунта
/v2/accounts/{account_id}/updateИзменить параметры аккаунта. Тело запроса — JSON.
Sent as the Authorization header. Your key is used only by your browser for this request — it is never sent to Docsbook or stored.
UUID аккаунта
/v2/accounts/{account_id}Отключить аккаунт от NN Agent.
Sent as the Authorization header. Your key is used only by your browser for this request — it is never sent to Docsbook or stored.
UUID аккаунта
Привязка аккаунтов к кампании#
Аккаунты сами по себе ничего не рассылают — они привязываются к кампании. Операции привязки и отвязки описаны на странице Кампании и контакты.
Дальше#
- Подключить аккаунт по API — порядок вызовов целиком.
- Диалоги — что читать и отправлять после подключения.
- Мульти-аккаунтинг — та же механика в кабинете.