Skip to main content

Sending Telegram notifications about events in your Space

In this article, we'll explain how to set up automatic Telegram notifications for important events in your Uspacy Space

Uspacy Support Team avatar
Written by Uspacy Support Team
Updated over a week ago

Do you want to automatically receive Telegram notifications about events in your Uspacy Space? Assigning tasks, creating CRM elements, new activities —all of this can be monitored in real-time. To do this, just correctly configure automation that will react to these events in the Space and inform you via Telegram.

Let's look at this scenario using the example of sending a notification about the creation of a new task.

Let's go step-by-step ⬇️

Preparatory actions

Before setting up the conditional action in your Space, it's crucial to properly prepare the request.

For this, we need:

Telegram Bot, its Token, and chat ID

If you don't have your own bot, create one.

🔍 You can read how to do this HERE.

If you already have a bot, get its token.

🔍 You can read how to do this HERE.

Also, get the ID (chat_id) of your chat with the bot. You can do this with the following request in your browser's address bar:

https://api.telegram.org/bot<N>/getUpdates

Where:

🟣 https://api.telegram.org – This is the official address of the Telegram Bot API, through which interaction with bots in Telegram occurs.

🟣 <N> – Your Telegram bot's token.

🟣 getUpdates – A method that returns the latest actions of users who have interacted with the bot: sent messages, clicked buttons, etc.

❗️ If your request doesn't show any results (i.e., result: [] or nothing at all), the reason might be that no one has messaged the bot yet. And a bot cannot initiate a conversation with a user first. Therefore, you need to first send a message to the bot, and then repeat the getUpdates request to get the chat_id.

Formatted notification request and message appearance setup

https://api.telegram.org/bot<N>/sendMessage?chat_id=<ID>&parse_mode=html&text=

<Your text>%0A

<Your text>%0A

<Your text>

Where:

🟣 https://api.telegram.org – This is the official address of the Telegram Bot API, through which interaction with bots in Telegram occurs.

🟣 <N> – Your Telegram bot's token.

🟣 sendMessage – A method used to send a message from the bot to a chat.

🟣 <ID> – Your chat ID with the bot. We described how to get it above ⬆️

🟣 parse_mode=html – A method that allows you to format text using HTML tags. You can read more about this in Telegram's own knowledge base.

🟣 <Your text> – The text for your message (you can also use emojis).

🟣 %0A – This is the URL-encoded character for a line break (equivalent to the Enter key). Accordingly, when you form a message in the URL for the sendMessage request, you should insert %0A instead of a regular line break.


Here's an example of the notification request and the appearance of the message about a new task assignment:

✅ <b>New task created

⬇️</b> %0A

📝 Title: %0A

👤 Person responsible: %0A

📆 Creation date: %0A

🔗 <a

Setting up the Conditional Action

First, select a trigger. In our example, this is the creation of a new task.

Next, specify the action Execute a Webhook.

In the Endpoint URL field, paste the request we prepared earlier.

💡 It's best to place it on a single line, without unnecessary visual spaces. Their role in the final text is already played by the %0A URL code.

Then, specify the data indicators so that the conditional action affects the correct element (the one that triggered it) and passes the necessary information about it.

Finally, just Create the configured conditional action. Also, make sure the activity toggle is turned on—only then will it become active.

Result

Create a new task in your Space.

You'll receive a notification and a new message in your chat with the bot in Telegram. Open it and you'll see that it contains the information we configured earlier.

If you have additional questions or you need to contact the support, send a request to this email [email protected]



Did this answer your question?