How to connect Telegram with Navixy IoT Logic
Integrate a Telegram bot with Navixy IoT Logic to send automated notifications. Set up the bot, configure the chat ID, and connect the webhook.
This is a quick guide of the steps that might be followed to create the connection between IoT Logic and Telegram.
Create a bot and get your token
In Telegram, open the chat with @BotFather.
Run the command /newbot.
Follow the instructions and copy the bot token provided (it looks like: 123456:ABC-...).
Get the chat_id you want to message
Common ways to do this:
Send a message to your bot (or add it to a group and send a message there).
Then call the getUpdates method from the Telegram API.
If it's a group, the chat_id is usually a negative number.
Make sure the bot has received at least one message so it appears in getUpdates.

Send the message (REST call)
Use the sendMessage method from the Telegram API.
In the request body, include the chat_id and the message text.
The request should be sent in JSON format with the header Content-Type: application/json.

Create the IoT Flow in Navixy
Once the flow has been created, connect the Webhook node in the section where you want to send the data.
Follow the same structure as the API call. In the URL field, place the request endpoint:
https://api.telegram.org/bot<BOT_TOKEN>/sendMessage
In the Headers section:
Key: Content-Type
Value: application/json
Finally, in the body of the request, include the telemetry parameters you want to send, making sure to include the chat_id again, for instance:
{
"chat_id": X,
"text": "Device 12563254, latitude: {{latitude}}, longitude: {{longitude}}, satellites: {{satellites}}, speed: {{speed}}"
}


With these steps, your bot will be able to receive messages successfully, including automated telemetry data from Navixy.
Last updated
Was this helpful?