staqlydocs
REST APIAPI referenceChannels

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.

POST
/v1/channels/telegram/connect

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

Authorization

headerAuthorizationBearer <token>

API key (stk_...), or in the Community Edition the access token (stk_local_...)

Request Body

application/json
  1. body
group_id?string

Response Body

Created

application/json
  1. response

A code to connect a Telegram chat through the server's bot, and what became of it

code*string
command*string

What to send in the chat: /connect@bot CODE (addressed to the server's bot, so other bots leave it alone)

bot*string

The bot to add (@username)

expires_at*string
Formatdate-time
status*string

waiting: no /connect yet, or the last one failed (error says why)

Value in"waiting""connected""expired"
channel_id?string
error?string
Example Request
curl -X POST 'https://staqly.example.com/v1/channels/telegram/connect' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "code": "string",  "command": "string",  "bot": "string",  "expires_at": "2019-08-24T14:15:22Z",  "status": "waiting",  "channel_id": "string",  "error": "string"}