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

Messenger API

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

Telegram: группы и каналы

Участники, ссылки на вступление, темы форума, настройки и пригласительные ссылки групп и каналов.

Группы и каналы — тоже peer (отрицательные id). Настройки применяются по полям — меняются только переданные ключи.

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

GET /channels/{id}/chats/{peer}/members Group members

Право: channels:read

Параметры

idpath · integerобязательно

Channel id (from GET /channels)

peerpath · stringобязательно

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

qquery · string
filterquery · string: admins | bots | kicked | banned
limitquery · integer

Ответ 200 · Peer[]

id integertype stringtitle stringusername stringphone string

curl https://chatvendor.net/api/v1/channels/1/chats/@username/members \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
POST /channels/{id}/chats/join Join a group or channel

Право: channels:write

Параметры

idpath · integerобязательно

Channel id (from GET /channels)

Тело запроса (application/json)

linkstringобязательно

Ответ 200 · Peer

id integertype stringtitle stringusername stringphone string

curl -X POST https://chatvendor.net/api/v1/channels/1/chats/join \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
  -H "Content-Type: application/json" \
  -d '{"link":"…"}'
GET /channels/{id}/chats/{peer}/topics Forum topics of a supergroup

Право: 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 · Topic[]

id integertitle stringclosed booleanpinned booleanhidden booleanunread_count integertop_message integer

curl https://chatvendor.net/api/v1/channels/1/chats/@username/topics \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
POST /channels/{id}/chats/{peer}/topics Create a forum topic

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

titlestringобязательно
icon_colorinteger
icon_emoji_idinteger

Ответ 200 · Topic

id integertitle stringclosed booleanpinned booleanhidden booleanunread_count integertop_message integer

curl -X POST https://chatvendor.net/api/v1/channels/1/chats/@username/topics \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
  -H "Content-Type: application/json" \
  -d '{"title":"…","icon_color":1,"icon_emoji_id":1}'
PATCH /channels/{id}/chats/{peer}/topics/{topic} Rename / close / hide / pin a topic

Право: channels:write

Параметры

idpath · integerобязательно

Channel id (from GET /channels)

peerpath · stringобязательно

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

topicpath · integerобязательно

Topic id

Тело запроса (application/json)

titlestring
closedboolean
hiddenboolean
pinnedboolean

Ответ 200

OK

curl -X PATCH https://chatvendor.net/api/v1/channels/1/chats/@username/topics/42 \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
  -H "Content-Type: application/json" \
  -d '[]'
PATCH /channels/{id}/chats/{peer}/settings Channel/supergroup switches (only the fields sent are applied)

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

usernamestring
signaturesboolean
join_to_sendboolean
join_requestboolean
slowmodeinteger: 0 | 10 | 30 | 60 | 300 | 900 | 3600
noforwardsboolean
discussionstring
reactionsstring

"all" | "none" | ["👍", "❤"]

history_hiddenboolean
forumboolean

Ответ 200 · Applied

applied string[]

curl -X PATCH https://chatvendor.net/api/v1/channels/1/chats/@username/settings \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
  -H "Content-Type: application/json" \
  -d '[]'
POST /channels/{id}/chats/{peer}/invite-links Create an invite link

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

titlestring
expirestring (date-time)
usage_limitinteger
request_neededboolean

Ответ 200 · InviteLink

link stringtitle stringrevoked booleanpermanent booleanrequest_needed booleanusage integerusage_limit integerexpire_date string (date-time)

curl -X POST https://chatvendor.net/api/v1/channels/1/chats/@username/invite-links \
  -H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
  -H "Content-Type: application/json" \
  -d '[]'