Мазмұнға өту

Messenger API

Панель қосылған Instagram, WhatsApp немесе Telegram аккаунтымен істей алатынның бәрі REST арқылы — бір кілт, бір жауап пішіні, тарау бойынша.

Messenger, сайттағы чат

Facebook парағы (fb_{id}) және сайт виджеті (web_{id}) үшін сол чат эндпоинттері.

Base URL: https://chatvendor.net/api/v1 · every response is {"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}

Scope: channels:read

Parameters

idpath · integerrequired

Channel id (from GET /channels)

Response 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)

Scope: channels:write

Parameters

idpath · integerrequired

Channel id (from GET /channels)

peerpath · stringrequired

Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone

Body (application/json)

textstring
reply_tointeger
buttonsstring[]

Response 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}

Scope: channels:read

Parameters

idpath · integerrequired

Channel id (from GET /channels)

Response 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)

Scope: channels:write

Parameters

idpath · integerrequired

Channel id (from GET /channels)

peerpath · stringrequired

Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone

Body (application/json)

textstring
buttonsstring[]

Response 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}

Scope: channels:read

Parameters

idpath · integerrequired

Channel id (from GET /channels)

Response 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)

Scope: channels:write

Parameters

idpath · integerrequired

Channel id (from GET /channels)

peerpath · stringrequired

Telegram peer: numeric id (channels/groups negative, e.g. -1001234567890), @username or phone

Body (application/json)

textstring
buttonsstring[]

Response 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":[]}'
GET /site/widgets Chat widgets of the workspace, each with its key and embed code

Scope: channels:read

Response 200

OK

curl https://chatvendor.net/api/v1/site/widgets \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
POST /site/widgets Create a chat widget for a site (name, domain); returns its key

Scope: channels:write

Body (application/json)

namestring
domainstring

Response 200

OK

curl -X POST https://chatvendor.net/api/v1/site/widgets \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
  -H "Content-Type: application/json" \
  -d '{"name":"…","domain":"…"}'
POST /site/submissions Hand over a form entry, order or sign-up: becomes a conversation (matched by phone or e-mail) and a lead. Repeating the same reference is ignored for a day

Scope: channels:write

Body (application/json)

sourcestring
namestring
phonestring
emailstring
messagestring
fieldsobject
pagestring
tagsstring[]
amountnumber
referencestring
leadboolean

Response 200

OK

curl -X POST https://chatvendor.net/api/v1/site/submissions \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
  -H "Content-Type: application/json" \
  -d '[]'