Skip to main content
Let’s learn how to connect Engini to Telegram. This integration lets your workflows send and manage messages, files and chats through a Telegram bot, and start a workflow when someone writes to your bot. To get started, create an account at Telegram.

Add a Connection to Telegram in Engini

Prerequisites

  • A Telegram account.
  • A Telegram bot and its API token, created with BotFather.

Retrieve your Telegram API Token

  1. Open BotFather in Telegram: search for @BotFather in your Telegram app. BotFather - Search
  2. Start a chat by sending the command /start and follow the instructions.
  3. Create a new bot: send the command /newbot, then follow the instructions to give your bot a Name (how users see it) and a Username (its unique ID, must end in “bot”). BotFather - New bot
  4. Copy the API token: after the bot is created, BotFather gives you an HTTP API Token. You will paste it into Engini.

Connecting Engini to Telegram

  1. Enter your Engini account at https://app.engini.io.
  2. Navigate to the Connections page by clicking on Connections in the left sidebar or by clicking here. Engini - Connections page
  3. Click on the “New Integration” option located at the top bar. Engini - New Integration button
  4. Choose the Telegram option from the available applications. Telegram - Choose Application
  5. Enter the following details in the “New Integration” form and press Save: Telegram - New Integration form 1. Connection Name - Enter a name that helps identify the Telegram connection. 2. Token - Enter your bot’s HTTP API token, the one BotFather gave you when you created your bot (it looks like 123456789:ABC…). It is the only credential Engini needs to connect to your bot. 3. Save - Click Save to create the connection.
Engini uses the token with every Telegram request made through this connection, so you don’t need to add it to any trigger or action.

Triggers

Telegram Webhook

Starts the workflow when your bot receives an update, such as a message sent to it. Telegram - Telegram Webhook trigger
  • Update Types - Choose which kinds of updates start the workflow, for example Message, Edited Message, Channel Post or Callback Query. You can select several. Leave it empty to receive Telegram’s default set of updates, which does not include reaction updates. To receive them, select Message Reaction or Message Reaction Count.
The available update types are: Message, Edited Message, Channel Post, Edited Channel Post, Inline Query, Chosen Inline Result, Callback Query, Shipping Query, Pre Checkout Query, My Chat Member, Chat Join Request, Chat Member, Poll, Poll Answer, Message Reaction, Message Reaction Count, Chat Boost and Removed Chat Boost. There is nothing to copy or register: when you turn the workflow on, Engini registers the trigger with your bot automatically. Each update of a selected type starts one run of the workflow, and the update details (such as the text, the sender and the chat) are available to the next steps. Note: Messages sent by the bot itself do not start the workflow. Note: Your workflow receives the real Telegram update when it runs. The Dynamic Content list for this trigger may show a different structure, so if a field you expect is missing from the list, run the workflow once and check the data it received.

Actions

Most actions need a Chat Id. Telegram gives each private chat, group and channel its own ID. Where an action offers a list, pick the chat from it instead of typing the ID. The list shows only chats that were active in the last 24 hours, so a chat that has been quiet for longer will not appear. You can also map the ID from the Telegram Webhook trigger when someone writes to your bot.

Send a Text Message

Sends a text message from your bot to a chat. Telegram - Send a Text Message action
  1. Chat Id - Enter the ID of the chat (private chat, group or channel). You can also map it from a previous step, for example the Telegram Webhook trigger.
  2. Text - Type the message you want to send. You can use data from previous steps in your workflow to make the message dynamic.
  3. Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.
Optional fields available through Add Field: Message Thread Id, Parse Mode, Link Preview Options, Disable Notification, Protect Content, Message Effect Id, Reply Parameters, Reply Markup.

Update a Text message

Edits the text of a message your bot already sent. Telegram - Update a Text message action
  1. Chat Id - The ID of the chat (private chat, group or channel). Pick it from the list of chats (only chats active in the last 24 hours appear), map it from a previous step such as the Telegram Webhook trigger, or type it.
  2. Message Id - The ID of the message. Pick it from the list of recent messages (only the last 24 hours), map it from a previous step, or type it.
  3. Text - Enter the new text of the message.
  4. Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.
Optional fields available through Add Field: Inline Message Id, Parse Mode, Link Preview Options, Reply Markup.

Update a Message Caption

Edits the caption of a media message your bot sent, such as a photo, video or document. Telegram - Update a Message Caption action
  1. Chat Id - The ID of the chat (private chat, group or channel). Pick it from the list of chats (only chats active in the last 24 hours appear), map it from a previous step such as the Telegram Webhook trigger, or type it.
  2. Message Id - The ID of the message whose caption you want to change. Pick it from the list of recent messages (only the last 24 hours), map it from a previous step, or type it.
  3. Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.
Optional fields available through Add Field: Caption, Parse Mode, Reply Markup.

Update Media Message

Replaces the media of a message your bot sent. Telegram - Update Media Message action
  1. Chat Id - The ID of the chat (private chat, group or channel). Pick it from the list of chats (only chats active in the last 24 hours appear), map it from a previous step such as the Telegram Webhook trigger, or type it.
  2. Message Id - The ID of the message. Pick it from the list of recent messages (only the last 24 hours), map it from a previous step, or type it.
  3. Type - Enter the type of the new media.
  4. Media - Enter the new media file.
  5. Caption - Enter the caption for the new media.
  6. Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.
Optional fields available through Add Field: Reply Markup.

Forward a Message

Forwards a message from one chat to another. Telegram - Forward a Message action
  1. Chat Id - The ID of the chat you want to forward the message to. Pick it from the list of chats (only chats active in the last 24 hours appear), map it from a previous step such as the Telegram Webhook trigger, or type it.
  2. From Chat Id - The ID of the chat the message comes from. Pick it from the list of chats (only chats active in the last 24 hours appear), map it from a previous step such as the Telegram Webhook trigger, or type it.
  3. Message Id - The ID of the message. Pick it from the list of recent messages (only the last 24 hours), map it from a previous step, or type it.
  4. Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.
Optional fields available through Add Field: Message Thread Id, Video Start Timestamp, Disable Notification, Protect Content.

Delete Message

Deletes a message from a chat. Telegram - Delete Message action
  1. Chat Id - The ID of the chat (private chat, group or channel). Pick it from the list of chats (only chats active in the last 24 hours appear), map it from a previous step such as the Telegram Webhook trigger, or type it.
  2. Message Id - The ID of the message. Pick it from the list of recent messages (only the last 24 hours), map it from a previous step, or type it.

Pin a Message

Pins a message at the top of a chat. Telegram - Pin a Message action
  1. Chat Id - The ID of the chat (private chat, group or channel). Pick it from the list of chats (only chats active in the last 24 hours appear), map it from a previous step such as the Telegram Webhook trigger, or type it.
  2. Message Id - The ID of the message. Pick it from the list of recent messages (only the last 24 hours), map it from a previous step, or type it.
  3. Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.
Optional fields available through Add Field: Disable Notification, Business Connection Id. Note: The bot must be an administrator of the chat with the right to pin messages, otherwise Telegram rejects the request.

Unpin a Message

Unpins a message from a chat. Telegram - Unpin a Message action
  1. Chat Id - The ID of the chat (private chat, group or channel). Pick it from the list of chats (only chats active in the last 24 hours appear), map it from a previous step such as the Telegram Webhook trigger, or type it.
  2. Message Id - The ID of the message you want to unpin. Pick it from the list of recent messages (only the last 24 hours), map it from a previous step, or type it.
  3. Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.
Optional fields available through Add Field: Business Connection Id. Note: The bot must be an administrator of the chat with the right to pin messages, otherwise Telegram rejects the request.

Send an Image

Sends an image from your bot to a chat. Telegram - Send an Image action
  1. Chat Id - The ID of the chat (private chat, group or channel). Pick it from the list of chats (only chats active in the last 24 hours appear), map it from a previous step such as the Telegram Webhook trigger, or type it.
  2. File Id - The Telegram file ID of the file to send. Pick it from the list of recent files (only the last 24 hours), map it from a previous step, or type it.

Send a Document

Sends a document, such as a PDF, from your bot to a chat. Telegram - Send a Document action
  1. Chat Id - Enter the ID of the chat (private chat, group or channel). You can also map it from a previous step, for example the Telegram Webhook trigger.
  2. File Id - Enter the Telegram file ID of the file to send. You can map it from a previous step, for example the Telegram Webhook trigger when a user sends a file to your bot.
  3. Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.
Optional fields available through Add Field: Business Connection Id, Message Thread Id, Direct Messages Topic Id, Receiver User Id, Callback Query Id, Thumbnail, Caption, Parse Mode, Caption Entities, Disable Content Type Detection, Disable Notification, Protect Content, Allow Paid Broadcast, Message Effect Id, Suggested Post Parameters, Reply Parameters, Reply Markup.

Send an Album

Sends a group of photos, videos or files from your bot to a chat as one album. Telegram - Send an Album action
  1. Chat Id - The ID of the chat (private chat, group or channel). Pick it from the list of chats (only chats active in the last 24 hours appear), map it from a previous step such as the Telegram Webhook trigger, or type it.
  2. Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.
Optional fields available through Add Field: Media, Disable Notification, Protect Content.

Send a Sticker

Sends a sticker from your bot to a chat. Telegram - Send a Sticker action
  1. Chat Id - The ID of the chat (private chat, group or channel). Pick it from the list of chats (only chats active in the last 24 hours appear), map it from a previous step such as the Telegram Webhook trigger, or type it.
  2. File Id - The Telegram file ID of the file to send. Pick it from the list of recent files (only the last 24 hours), map it from a previous step, or type it.
  3. Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.
Optional fields available through Add Field: Emoji, Disable Notification, Protect Content, Message Thread Id, Reply Markup.

Send Video

Sends a video from your bot to a chat. Telegram - Send Video action
  1. Chat Id - The ID of the chat (private chat, group or channel). Pick it from the list of chats (only chats active in the last 24 hours appear), map it from a previous step such as the Telegram Webhook trigger, or type it.
  2. File Id - The Telegram file ID of the file to send. Pick it from the list of recent files (only the last 24 hours), map it from a previous step, or type it.
  3. Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.
Optional fields available through Add Field: Caption, Duration, Width, Height, Supports Streaming, Has Spoiler, Reply Markup.

Send a Video Note

Sends a round video message from your bot to a chat. Telegram - Send a Video Note action
  1. Chat Id - The ID of the chat (private chat, group or channel). Pick it from the list of chats (only chats active in the last 24 hours appear), map it from a previous step such as the Telegram Webhook trigger, or type it.
  2. File Id - The Telegram file ID of the file to send. Pick it from the list of recent files (only the last 24 hours), map it from a previous step, or type it.
  3. Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.
Optional fields available through Add Field: Duration, Length, Disable Notification, Protect Content, Reply Markup. Note: Telegram sends the file as a regular video, not as a round video note, when the video is not square.

Send a Voice Message

Sends an audio recording from your bot to a chat as a voice message. Telegram - Send a Voice Message action
  1. Chat Id - The ID of the chat (private chat, group or channel). Pick it from the list of chats (only chats active in the last 24 hours appear), map it from a previous step such as the Telegram Webhook trigger, or type it.
  2. File Id - The Telegram file ID of the file to send. Pick it from the list of recent files (only the last 24 hours), map it from a previous step, or type it.
  3. Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.
Optional fields available through Add Field: Caption, Parse Mode, Duration, Disable Notification, Protect Content. Note: Use an OGG file encoded with Opus. Telegram shows other audio files, such as OGG Vorbis, as a regular document instead of a voice message.

Send an Invoice

Sends an invoice message from your bot to a chat. Telegram - Send an Invoice action
  1. Chat Id - The ID of the chat (private chat, group or channel). Pick it from the list of chats (only chats active in the last 24 hours appear), map it from a previous step such as the Telegram Webhook trigger, or type it.
  2. Title - Enter the product name.
  3. Description - Enter a description of the product.
  4. Payload - Enter an internal identifier for the invoice. It is returned to your bot after the payment and is not shown to the customer.
  5. Provider Token - Enter the token of your payment provider.
  6. Currency - Enter the three-letter currency code, for example USD.
  7. Prices - Enter the list of price items that make up the total.
  8. Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.
Optional fields available through Add Field: Photo Url, Photo Width, Photo Height, Need Name, Need Phone Number, Send Phone Number To Provider, Is Flexible.

Get File

Retrieves information about a file, such as its path on Telegram’s servers. Telegram - Get File action
  • File Id - The Telegram file ID. Pick it from the list of recent files (only the last 24 hours), map it from a previous step, or type it.

Download File

Downloads a file from Telegram. Telegram - Download File action
  • File Path - Enter the file path returned by Get File.

Get Updates

Retrieves the messages and other updates your bot has received. Telegram - Get Updates action
  1. Top N - You can set the maximum number of records Engini will return for the object you chose (default = all records).
  2. Offset - The offset parameter allows you to skip a certain number of records from the beginning of the result set (default = 0 records).
  3. Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.
Optional fields available through Add Field: Timeout, Allowed Updates.

Get Chat

Retrieves information about a chat. Telegram - Get Chat action
  • Chat Id - The ID of the chat you want to inspect. Pick it from the list of chats (only chats active in the last 24 hours appear), map it from a previous step such as the Telegram Webhook trigger, or type it.

Get Administrators in a Chat

Retrieves the list of administrators of a group or channel. Telegram - Get Administrators in a Chat action
  • Chat Id - The ID of the chat (private chat, group or channel). Pick it from the list of chats (only chats active in the last 24 hours appear), map it from a previous step such as the Telegram Webhook trigger, or type it.

Get the Number of Members in a Chat

Retrieves the number of members in a group or channel. Telegram - Get the Number of Members in a Chat action
  • Chat Id - The ID of the chat (private chat, group or channel). Pick it from the list of chats (only chats active in the last 24 hours appear), map it from a previous step such as the Telegram Webhook trigger, or type it.
Creates a new invite link for a group or channel. Telegram - Create a Chat Invite Link action
  1. Chat Id - The ID of the group or channel. Pick it from the list of chats (only chats active in the last 24 hours appear), map it from a previous step such as the Telegram Webhook trigger, or type it.
  2. Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.
Optional fields available through Add Field: Name, Expire Date, Member Limit, Creates Join Request. Note: The bot must be an administrator of the chat with the right to invite users, otherwise Telegram rejects the request. Edits an invite link that your bot created. Telegram - Update Chat Invite Link action
  1. Chat Id - The ID of the group or channel where the link was created. Pick it from the list of chats (only chats active in the last 24 hours appear), map it from a previous step such as the Telegram Webhook trigger, or type it.
  2. Invite Link - Enter the invite link you want to update.
  3. Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.
Optional fields available through Add Field: Name, Expire Date, Member Limit, Creates Join Request. Revokes an invite link so that it can no longer be used to join the chat. Telegram - Delete Chat Invite Link action
  1. Chat Id - The ID of the group or channel where the link was created. Pick it from the list of chats (only chats active in the last 24 hours appear), map it from a previous step such as the Telegram Webhook trigger, or type it.
  2. Invite Link - Enter the invite link you want to revoke.
Note: The bot must be an administrator of the chat with the right to invite users, otherwise Telegram rejects the request.

Kick a Chat Member

Removes a user from a group or channel. Telegram - Kick a Chat Member action
  1. Chat Id - The ID of the group or channel. Pick it from the list of chats (only chats active in the last 24 hours appear), map it from a previous step such as the Telegram Webhook trigger, or type it.
  2. User Id - The Telegram ID of the user you want to remove. Pick it from the list of recent users (only those active in the last 24 hours), map it from a previous step, or type it.
  3. Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.
Optional fields available through Add Field: Until Date, Revoke Messages. Note: Telegram rejects the request when your bot is not an administrator of the chat.

Promote a Chat Member

Gives a user administrator rights in a group or channel. Telegram - Promote a Chat Member action
  1. Chat Id - The ID of the group or channel. Pick it from the list of chats (only chats active in the last 24 hours appear), map it from a previous step such as the Telegram Webhook trigger, or type it.
  2. User Id - The Telegram ID of the user you want to promote. Pick it from the list of recent users (only those active in the last 24 hours), map it from a previous step, or type it.
  3. Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.
Optional fields available through Add Field: Can Manage Chat, Can Post Messages, Can Edit Messages, Can Delete Messages, Can Invite Users, Can Restrict Members, Can Pin Messages, Can Promote Members. Note: Telegram accepts this action only in a supergroup.

Restrict a Chat Member

Limits what a user can do in a supergroup. Telegram - Restrict a Chat Member action
  1. Chat Id - The ID of the supergroup. Pick it from the list of chats (only chats active in the last 24 hours appear), map it from a previous step such as the Telegram Webhook trigger, or type it.
  2. User Id - The Telegram ID of the user you want to restrict. Pick it from the list of recent users (only those active in the last 24 hours), map it from a previous step, or type it.
  3. Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.
Optional fields available through Add Field: Permissions, Until Date. Note: Telegram accepts this action only in a supergroup.

Get Me (Bot)

Retrieves basic information about your bot, such as its name and username. Telegram - Get Me (Bot) action

Send API Request

This activity allows you to send a custom API request directly to Telegram’s Bot API. Telegram - Send API Request action
  1. Base Url - The root address Engini sends the request to. It is filled in automatically from your Telegram connection (https://api.telegram.org/bot followed by your bot’s token) and can’t be edited here, so you never type the token yourself.
  2. Relative url - The Telegram Bot API method you want to call, added to the end of the Base Url. Start it with a slash, for example /getMe or /sendChatAction. Every method name is listed in the Telegram Bot API reference.
  3. Method - The HTTP method of the request. Telegram accepts GET and POST for its methods, so use POST when you send a body and GET when you only read data. POST is selected by default; the list also offers PUT, PATCH and DELETE, which Telegram doesn’t use.
  4. Body Type - The format of the data you send in the Body. For Telegram, keep application/json (the default) and write the Body as JSON. Choose multipart/form-data only when a method uploads a file.
  5. Body - The data you send to the method, written as JSON, for example {"chat_id": 123456789, "action": "typing"} for /sendChatAction. Each method’s required parameters are listed in the Bot API reference. Leave it empty for methods that take no parameters, such as /getMe.
  6. Add Headers - Extra request headers, entered as a name and a value. Telegram doesn’t need any, because the Body Type already sets the content type and the token is part of the Base Url, so you can usually skip it.
  7. Add Queries - Parameters added to the end of the URL, entered as a name and a value, for example chat_id with the value -1001234567890 when you call /getChatMemberCount with GET. Use them instead of a Body for simple GET calls.
For the full list of methods, see the Telegram Bot API reference.