How to use Telegram API with Jet WorkFlow

How to use Telegram API with Jet WorkFlow

We will need to create a telegram bot in order to generate the chat id required for the telegram API to work.

Create a Telegram Bot

Go to the Telegram app (https://telegram.org/) and search for BotFather.

Start a chat with BotFather and use the ‘/newbot’ command to create a new bot.

BotFather will guide you through naming your bot and will provide a bot token (API key) which you will need later.

Send a Message Using the API
				
					https://api.telegram.org/bot<your-bot-token>/sendMessage?chat_id=<chat id>&text=<yourtext>
				
			

You can use either HTTP GET or POST to run the API.

These are the parameters you need.

  • ‘your-bot-token’: The bot token we get during the bot creation process.
  • ‘chat_id’: The chat or user ID to send the message to.
  • ‘text’: The message text you want to send.
How to get Chat ID

In order to get the chat_id required to send message, you will need to first send a message to the bot we created earlier.

 

Next we need to run the below url in your browser.

Fill in the bot token that you get during the bot creation.

				
					https://api.telegram.org/bot<your-bot-token>/getUpdates
				
			

In this example, the chat id is 1234567890

And using it in the sendMessage API, it will be like this.

				
					https://api.telegram.org/bot<your-bot-token>/sendMessage?chat_id=1234567890&text=hello
				
			

And since we are going to be using this in automation, we can do something like the below, where {name} is the field name of the form we are using.

				
					https://api.telegram.org/bot<your-bot-token>/sendMessage?chat_id=1234567890&text={name}
				
			
Suggest Edit
×

Hello!

Click one of our representatives below to chat on WhatsApp or send an email to sales@jetworkflow.com

× How can I help you?