Перейти к содержимому
ChatVendor ChatVendor

Messenger API

Всё, что панель умеет с подключённым аккаунтом Telegram, WhatsApp или Instagram, — через REST: один ключ, один формат ответа, по разделам.

Instagram

Direct, ответы на комментарии, ответы на сторис и файлы Instagram-аккаунта (ig_{id}).

Instagram-аккаунты в GET /channels имеют вид ig_12; {peer} — IGSID человека, который вам написал. Строки содержат kind: comment | story_reply | story_mention. reply_to + public_reply=true отвечает на комментарий публично; иначе первое сообщение комментатору уходит как приватный ответ (7 дней).

Base URL: https://chatvendor.net/api/v1 · каждый ответ {"success": true, "data": …}

GET /channels/ig_{id}/dialogs Instagram: Direct chats of the account (peer = IGSID; rows carry kind: comment | story_reply | story_mention)

Право: 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/ig_1/dialogs \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
GET /channels/ig_{id}/dialogs/{peer}/messages Instagram: messages of a chat

Право: 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/ig_1/dialogs/@username/messages \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
POST /channels/ig_{id}/dialogs/{peer}/messages Instagram: send text or quick-reply buttons; reply_to + public_reply=true answers a comment row publicly, otherwise the first message to a commenter goes as a private reply

Право: 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)

textstring
buttonsstring[]
reply_tointeger
public_replyboolean

Ответ 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/ig_1/dialogs/@username/messages \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
  -H "Content-Type: application/json" \
  -d '[]'
POST /channels/ig_{id}/dialogs/{peer}/file Instagram: send a file (multipart: file, caption, as=auto|document|voice)

Право: 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/ig_1/dialogs/@username/file \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
  -F "file=@photo.jpg" -F "caption=…"
POST /channels/ig_{id}/dialogs/{peer}/read Instagram: mark seen

Право: 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/ig_1/dialogs/@username/read \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"