Messenger API
Всё, что панель умеет с подключённым аккаунтом Telegram, WhatsApp или Instagram, — через REST: один ключ, один формат ответа, по разделам.
Messenger, Viber, чат на сайте
Те же эндпоинты чатов для страницы Facebook (fb_{id}), Viber-бота (vb_{id}) и виджета сайта (web_{id}).
Base URL: https://chatvendor.net/api/v1 · каждый ответ {"success": true, "data": …}
GET
/channels/fb_{id}/dialogs
Messenger (Facebook Page): chats (peer = PSID). Messages, file, read, media: the same paths as WhatsApp with fb_{id}
channels:read
Право: channels:read
Параметры
idpath · integerобязательноChannel id (from GET /channels)
Ответ 200 · Dialog[]
peer_id integertype stringtitle stringusername stringunread_count integerlast_message_at string (date-time)last_message_text string
curl https://chatvendor.net/api/v1/channels/fb_1/dialogs \
-H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
POST
/channels/fb_{id}/dialogs/{peer}/messages
Messenger: send text (buttons = quick replies; reply_to + public_reply answers a comment in the thread)
channels:write
Право: channels:write
Параметры
idpath · integerобязательноChannel id (from GET /channels)
peerpath · stringобязательноTelegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone
Тело запроса (application/json)
textstringreply_tointegerbuttonsstring[]Ответ 200 · ChatMessage
id integerchat_id integersender_id integersender_name stringout booleandate string (date-time)text stringmedia objectreply_to integertopic_id integerbuttons object[][]
curl -X POST https://chatvendor.net/api/v1/channels/fb_1/dialogs/@username/messages \
-H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
-H "Content-Type: application/json" \
-d '{"text":"…","reply_to":1,"buttons":[]}'
GET
/channels/vb_{id}/dialogs
Viber bot: chats (peer = local id; user ids are strings). Messages, file, read, media: the same paths as WhatsApp with vb_{id}
channels:read
Право: channels:read
Параметры
idpath · integerобязательноChannel id (from GET /channels)
Ответ 200 · Dialog[]
peer_id integertype stringtitle stringusername stringunread_count integerlast_message_at string (date-time)last_message_text string
curl https://chatvendor.net/api/v1/channels/vb_1/dialogs \
-H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
POST
/channels/vb_{id}/dialogs/{peer}/messages
Viber: send text (buttons = reply keyboard, up to 24; a button may carry url)
channels:write
Право: channels:write
Параметры
idpath · integerобязательноChannel id (from GET /channels)
peerpath · stringобязательноTelegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone
Тело запроса (application/json)
textstringbuttonsstring[]Ответ 200 · ChatMessage
id integerchat_id integersender_id integersender_name stringout booleandate string (date-time)text stringmedia objectreply_to integertopic_id integerbuttons object[][]
curl -X POST https://chatvendor.net/api/v1/channels/vb_1/dialogs/@username/messages \
-H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
-H "Content-Type: application/json" \
-d '{"text":"…","buttons":[]}'
GET
/channels/web_{id}/dialogs
Website widget: visitor chats (peer = visitor id). Messages, file, read, media: the same paths as WhatsApp with web_{id}
channels:read
Право: channels:read
Параметры
idpath · integerобязательноChannel id (from GET /channels)
Ответ 200 · Dialog[]
peer_id integertype stringtitle stringusername stringunread_count integerlast_message_at string (date-time)last_message_text string
curl https://chatvendor.net/api/v1/channels/web_1/dialogs \
-H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
POST
/channels/web_{id}/dialogs/{peer}/messages
Website widget: send text to a visitor (buttons render as chips; a button may carry url)
channels:write
Право: channels:write
Параметры
idpath · integerобязательноChannel id (from GET /channels)
peerpath · stringобязательноTelegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone
Тело запроса (application/json)
textstringbuttonsstring[]Ответ 200 · ChatMessage
id integerchat_id integersender_id integersender_name stringout booleandate string (date-time)text stringmedia objectreply_to integertopic_id integerbuttons object[][]
curl -X POST https://chatvendor.net/api/v1/channels/web_1/dialogs/@username/messages \
-H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
-H "Content-Type: application/json" \
-d '{"text":"…","buttons":[]}'