- About JET
- Administration
- Creating an App
- Basic Functions
- Advanced Functions
- Automation Parameters
- Field Value Selection
- Field Value Formatting
- Field Value Manipulation
- Total Count of a Form
- Total Sum of Field
- Minimum Value of Field
- Maximum Value of Field
- Average Value of Field
- Site Level Parameters - Site Name
- Site Level Parameters - Login User
- Site Level Parameters - Login User Email
- Owner Email
- Check Permission Group
- Date Time Addition
- Email Image
- CheckBox Condition
- Usage of Time Fields
- 3rd Party API
- Other Features
- Known Issues & Solutions
- Linux
- Windows
- FAQ (JET)
7.1.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/sendMessage?chat_id=&text=
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/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/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/sendMessage?chat_id=1234567890&text={name}