Here's a quick guide on how to create a Telegram bot that will make posts on Telegram channel when API call is made from NetHunt.
Create a Telegram bot
Search for the “@Botfather” in the Telegram
Start a conversation and type “/newbot”
Enter the new bot’s name (this will be a display name)
Enter bot’s username (must end with “_bot”)
Get bot’s API Token
NOTE: Bots can’t message people first, but can message channels.
Get Channel details
Create a new channel (if you don’t have it yet)
Invite your bot to the Channel (search by bot’s username) and add it as an Admin
Go to https://api.telegram.org/bot{{TOKEN}}/getUpdates
Replace {{TOKEN}} with your bot’s TokenPost something to the channel with the bot (so the bot “sees” that it’s added to the channel)
Refresh the link above and it should have a list of all channels and conversations the bot participates in
Find the channel’s ID you want to send messages via the bot to.
NOTE: Channel’s IDs always start with a minus symbol (-).
Create a Workflow with Make an API call
In the Make an API call step, in the URL field, paste the following:
https://api.telegram.org/bot{{TOKEN}}/sendMessageIn the JSON field, enter the data you want to push via the Bot.
Syntax:
{
"chat_id": {{CHAT ID}},
"text": "{{ENTER YOUR MESSAGE}}",
"parse_mode": "HTML"
}Example:
{
"chat_id": -1001601660289,
"text": "<b>First name:</b> Anastasia\n<b>Last name:</b> Tatsenko\n<b>Company:</b> NetHunt CRM",
"parse_mode": "HTML"
}
NOTES:
1) "parse_mode": "HTML" is optional. Only need to include this line if the text in the “text” contains HTML tags like <b> to show this formatting.
2) Line breaks can be added by typing “\n”
Haven’t found the answers you’re looking for? Schedule a free assistance call with our Customer Success team.