Messenger API
Всё, что панель умеет с подключённым аккаунтом Telegram, WhatsApp или Instagram, — через REST: один ключ, один формат ответа, по разделам.
Чаты, сообщения, файлы и шаблоны номера WhatsApp Business (wa_{id}).
Номера WhatsApp в GET /channels имеют id вида wa_12; {peer} — телефон клиента в международном формате. Свободный текст разрешён только 24 часа после последнего сообщения клиента — вне окна отправляйте одобренный шаблон.
Base URL: https://chatvendor.net/api/v1 · каждый ответ {"success": true, "data": …}
GET
/channels/wa_{id}/dialogs
WhatsApp: chats of a number
channels:read
Право: channels:read
Параметры
idpath · integerобязательноChannel id (from GET /channels)
qquery · stringunreadquery · integerОтвет 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/wa_1/dialogs \
-H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
GET
/channels/wa_{id}/dialogs/{peer}/messages
WhatsApp: messages of a chat (peer = phone in international format)
channels:read
Право: channels:read
Параметры
idpath · integerобязательноChannel id (from GET /channels)
peerpath · stringобязательноTelegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone
Ответ 200 · ChatMessage[]
id integerchat_id integersender_id integersender_name stringout booleandate string (date-time)text stringmedia objectreply_to integertopic_id integerbuttons object[][]
curl https://chatvendor.net/api/v1/channels/wa_1/dialogs/@username/messages \
-H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
POST
/channels/wa_{id}/dialogs/{peer}/messages
WhatsApp: send text, an approved template, or reply buttons
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_tointegertemplatestringlanguagestringcomponentsobject[]buttonsobject[]buttons[].idstringbuttons[].titlestringОтвет 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/wa_1/dialogs/@username/messages \
-H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
-H "Content-Type: application/json" \
-d '[]'
POST
/channels/wa_{id}/dialogs/{peer}/file
WhatsApp: send a file (multipart: file, caption, as=auto|document|voice)
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
multipart/form-data — поля перечислены в описании выше.
Ответ 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/wa_1/dialogs/@username/file \
-H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
-F "file=@photo.jpg" -F "caption=…"
POST
/channels/wa_{id}/dialogs/{peer}/read
WhatsApp: mark the chat as read
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
Ответ 200
OK
curl -X POST https://chatvendor.net/api/v1/channels/wa_1/dialogs/@username/read \
-H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
GET
/channels/wa_{id}/dialogs/{peer}/messages/{message}/media
WhatsApp: download media
channels:read
Право: channels:read
Параметры
idpath · integerобязательноChannel id (from GET /channels)
peerpath · stringобязательноTelegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone
messagepath · integerобязательноMessage id
Ответ 200
The file
curl https://chatvendor.net/api/v1/channels/wa_1/dialogs/@username/messages/123/media \
-H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
GET
/channels/wa_{id}/templates
WhatsApp: message templates of the number
channels:read
Право: channels:read
Параметры
idpath · integerобязательноChannel id (from GET /channels)
Ответ 200 · Template[]
name stringstatus stringcategory stringlanguage stringbody string
curl https://chatvendor.net/api/v1/channels/wa_1/templates \
-H "Authorization: Bearer cv_live_xxxxxxxxxxxx"