Skip to main content
All CollectionsFeaturesFeatures
Telegram Interactive Messages API Reference
Telegram Interactive Messages API Reference

Learn how to send Telegram Interactive messages programmatically

Youssef Amir avatar
Written by Youssef Amir
Updated over a month ago

Once your Telegram channel is connected, we generate an API Key for your account to be used. You can retrieve your API Key directly from our Octopods App by selecting your channel. Please reach out to us to whitelist this feature for your channel first.

API Endpoints

Send an Interactive Message

The payload must be in JSON.
​
​Request (in cURL)

curl --location --request POST 'https://app.octopods.io/api/v1/telegram/interactive' \--header 'X-Octopods-Auth: YOUR_API_KEY' \--header 'Content-Type: application/json' \--data-raw '
{
"destination_user_id": "1234567890",
"telegram_interactive_message": {<INTERACTIVE_MESSAGE_PAYLOAD>},
"intercom_teammate_id": "5173352"
}'

Parameter

Possible Values

Description

Required

destination_user_id

Valid Telegram User ID

the destination user ID to send an interactive message

Yes

telegram_interactive_message

Hash Object
(see below)

Telegram Interactive Message payload

Yes

intercom_teammate_id

string

Intercom teammate ID assigned to this message.

No

Telegram Interactive Message

Read our docs about the supported interactive types and allowed parameters per type.

Types supported:

  • reply_buttons (equivalent to telegram: inline_keyboard)

  • reply_keyboard

  • remove_reply_keyboard

  • highlight_reply (equivalent to telegram: force_reply)


​Message Payload

Once you know the interactive message type and format you want to send, insert that payload in the telegram_interactive_message key in your request body:

Parameter

Possible Values

Description

Required

type

Only one of Interactive types (see above)

The interactive message type

Yes

text

String

The Interactive message text

Yes

reply_markup

Hash Object

check Telegram Bot API reply_markup parameter to know more.

Yes

Check Telegram Bot API to know more how to format the reply_markup parameter per interactive message type

Reply Buttons

"telegram_interactive_message": {
"type": "reply_buttons",
"text": "YO",
"reply_markup": {
"inline_keyboard": [
[
{"text": "Button 1 Text", "url": "Button URL"}
]
]
}
}
Did this answer your question?