A code to connect a Telegram chat through the server's bot
A code to connect a Telegram chat through the server's bot (channels:manage)
Every request sends Authorization: Bearer ...: the access token in local mode, an API key stk_... in cloud mode. Use Send to try it against your cloud instance with your API key.
Add the server's bot (bot in GET /v1/providers) to the channel or group, as an administrator allowed to
post in a channel, then send the command (/connect CODE) there. The server's bot finds it, checks the
chat and connects it as a channel of this workspace (in group_id, else Default); GET the code to see it.
A code lasts 10 minutes. 409 not_available when the server has no bot of its own (connect with
credential_fields then).
AuthorizationBearer <token>API key (stk_...), or in the Community Edition the access token (stk_local_...)
application/json- body
group_id?stringCreated
application/json- response
A code to connect a Telegram chat through the server's bot, and what became of it
code*stringcommand*stringWhat to send in the chat: /connect@bot CODE (addressed to the server's bot, so other bots leave it alone)
bot*stringThe bot to add (@username)
expires_at*stringdate-timestatus*stringwaiting: no /connect yet, or the last one failed (error says why)
"waiting""connected""expired"channel_id?stringerror?stringcurl -X POST 'https://staqly.example.com/v1/channels/telegram/connect' \ -H 'Content-Type: application/json' \ -d '{}'{ "code": "string", "command": "string", "bot": "string", "expires_at": "2019-08-24T14:15:22Z", "status": "waiting", "channel_id": "string", "error": "string"}