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
Право: 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 · stringfilterquery · string: admins | bots | kicked | bannedlimitquery · 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
Право: 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
Право: 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
Право: 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_colorintegericon_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
Право: 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)
titlestringclosedbooleanhiddenbooleanpinnedbooleanОтвет 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
Право: 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)
usernamestringsignaturesbooleanjoin_to_sendbooleanjoin_requestbooleanslowmodeinteger: 0 | 10 | 30 | 60 | 300 | 900 | 3600noforwardsbooleandiscussionstringreactionsstring"all" | "none" | ["👍", "❤"]
history_hiddenbooleanforumbooleanОтвет 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 '[]'
GET
/channels/{id}/chats/{peer}/invite-links
Invite links of a group/channel
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 · InviteLink[]
link stringtitle stringrevoked booleanpermanent booleanrequest_needed booleanusage integerusage_limit integerexpire_date string (date-time)
curl https://chatvendor.net/api/v1/channels/1/chats/@username/invite-links \
-H "Authorization: Bearer cv_live_xxxxxxxxxxxx"
POST
/channels/{id}/chats/{peer}/invite-links
Create an invite link
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)
titlestringexpirestring (date-time)usage_limitintegerrequest_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 '[]'