How to Connect Telegram as Data Destination

The integration will allow you to send messages to Telegram in response to an action on other systems. For example, if there is a new row in Google Sheets, the lead in CRM has moved to another stage of the funnel or when a new lead appears on your site, the message will be automatically sent to Telegram. This will allow you to automate workflows efficiently and save a lot of time.
Let's go through the entire Telegram setup steps together!
Navigation:
1. What will integration with Telegram do?
2. How to connect a Telegram account to ApiX-Drive?
Send MESSAGE
Send MESSAGE (your bot)
3. How to set up data transfer to Telegram in the selected action?
4. An example of the data will be sent to your Telegram.
5. Auto-update and update interval.
Answers to frequently asked questions:
1. There is no test message or response that the bot is successfully connected.
2. You have already connected the bot, but you need to transfer data to a group or channel.
After configuring Data Source, click "Start Configuring Data Destination"

Select the system as Data Destination. In this case, you must specify Telegram.

Next, you need to specify the action "Send MESSAGE".
You can add our bot and receive notifications from it about important events from other systems in your Telegram or group.

Send MESSAGE - messages will be sent to our ApiX-Drive |Notifications| bot based on data from the Data Source.
Send PHOTO - photos will be sent to our ApiX-Drive |Notifications| bot based on data from the Data Source.
Send VIDEO - videos will be sent to our ApiX-Drive |Notifications| bot based on data from the Data Source.
Send AUDIO - audio will be sent to our ApiX-Drive |Notifications| bot based on data from the Data Source.
Send VOICE MESSAGE - voice messages will be sent to our ApiX-Drive |Notifications| bot based on data from the Data Source.
Send DOCUMENT (FILE) - documents (files) will be sent to our ApiX-Drive |Notifications| bot based on data from the Data Source.
Send CONTACT – contacts will be sent to our ApiX-Drive |Notifications| bot based on data from the Data Source.
Send MESSAGE (your bot) – messages will be sent to your bot created in Telegram based on data from the Data Source.
Edit MESSAGE (your bot) – editable photos will be sent to your bot based on data from the Data Source.
Send REACTION to message (your bot) – reactions to messages will be sent to your bot based on data from the Data Source.
Delete NOTIFICATION (your bot) – messages from your bot will be deleted based on data from the Data Source.
Send PHOTO (your bot) – photos will be sent to your bot based on data from the Data Source.
Send VIDEO (your bot) – videos will be sent to your bot based on data from the Data Source.
Send DOCUMENT (FILE) (your bot) – documents (files) will be sent to your bot based on data from the Data Source.
Send AUDIO (your bot) – audio will be sent to your bot based on data from the Data Source.
Send VOICE MESSAGE (your bot) – voice messages will be sent to your bot based on data from the Data Source.
Send CONTACT (your bot) – contacts will be sent to your bot based on data from the Data Source.
The next step is to select the Telegram account from which will get the data.
If there are no accounts connected to the system, click "Connect account".

In the window that appears, enter the name of the account and click "Continue".

Next, a new window will open in which you need to copy the data in the "A line for connecting a Telegram bot" field.
Then close this window, reload the page and select the created account.
Now you need to go to your Telegram application.

In your Telegram application, enter @apix_drive_bot in the search bar.
Click on the bot profile and click "Start" or "Restart".

Send a message to the bot with the connection line that was copied from the ApiX-Drive system.
Wait for a response message about a successful connection to the system.
After that, return to the ApiX-Drive system and continue with the configuration.


Close the connection window and select the connected Telegram account, then click “Continue”.
Example of connecting Telegram with the action "Send MESSAGE (your bot)"

The next step is to select the Telegram account to which messages will be sent.
If there are no connected accounts to the ApiX-Drive system, click “Connect account”.

Fill in the fields with the appropriate information, where:
Token – the token for connecting your Telegram bot.
1. Create a new bot or use an existing one.
2. How to create a new bot is described here - https://hostiq.ua/blog/rus/chatbot-telegram
3. To find the token of an existing bot, you can enter the /mybots command in BotFather. Then, select the desired bot and click "API Token". Copy the token and paste it into the corresponding ApiX-Drive field.
Please note!
In the Access section, you can connect to a private chat, channel, or group. To do this, you need to create your own bot and add it as an administrator so that it has write access.
If you have previously connected the bot to other services, you will need to disconnect the first connection and reconnect the bot or create a new bot.
After entering the token in the required field, click "Save." This confirms the deletion of the previously installed webhook in the specified bot and also agrees to the installation of the ApiX-Drive webhook.

Please note: if the desired access is not listed, follow the steps described during connection, namely, message the bot directly and click the "Refresh" button.
For a channel or group, add the bot and click the "Refresh" button. If the bot was previously added, you will need to add it again.

In your Telegram application, in the search bar, enter @indicate_your_bot_username here.
Click on the bot's profile and click "Start". If you have connected this bot before, you will see a “Restart” button, click it.

Close the connection window and select the connected Telegram account, then click “Continue”.

Now, you need to compose a message from the data that will be sent to the Telegram bot.
In order to add a variable, click on the field "Message" and select the desired variable from the drop-down list. If necessary, you can write the data manually.
When the message is generated, click "Continue".



Now you can see the test data of what your message will look like.
To check the correctness of the settings - click "Send test data to Telegram" and go to your Telegram to check the result.
If everything suits you, click "Next" for further settings.

Please note!
If the test message does not arrive or there is no response that the bot is successfully connected, check the settings with which you launched the bot (Access - Messengers - Telegram), and which Telegram account (if several) was selected at the Access stage. If this did not help, follow the following algorithm of actions:
Reconnecting Your Bot
Step 1: Settings in BotFather
Make sure that your bot has the following parameters (command /setoptions or via the Bot Settings menu):
Allow Groups: Enabled - allows adding the bot to groups.
Chat Access Mode: Enabled (On) - permission to connect.
Group Admin Rights: Enabled (On) - administrator rights in groups.
Channel Admin Rights: Enabled (On) - administrator rights in channels.
Step 2: Clearing old connections
Remove the bot from the group or channel where you want to transfer data, if the bot has already been added before.
For a private chat, completely delete the dialogue with the bot and clear the message history.
Step 3: Reconnect
In your connection, at the "Access" stage, click "Connect".
Insert your bot's API Token and click "Save".
When you see the status "Successfully connected" (a green "Connected" tile and an empty chat list will appear) - RIGHT NOW add the bot to the group or channel as a member.
- If you want to transfer data to a GROUP or CHANNEL: Add the bot and be sure to grant it Administrator rights - the bot must have access to send messages. .
- If you want to transfer data to a PRIVATE CHAT (personally to the bot): Go to the dialogue with the bot, click "Start" and write it any message

Step 4: Updating the list
Return to your account and click the "Update" button next to the chat list.
Your group/channel/chat will appear in the drop-down list. Select the required access and complete the settings.
Please note: one connection via one API Token allows you to transfer data only to one selected chat (group, channel or private chat). It is impossible to simultaneously transfer data to several destinations using one bot - use a separate bot for each new chat.
Reconnecting the ApiX-Drive bot |Notifications|
If you want notifications to arrive to a channel or group, you need to add our bot to the group or channel, run it there and send it the settings. As a result, the group or channel should receive a response that the bot is successfully connected.
If you have already connected our bot to yourself before, and now you want to connect it to a group or channel, you need to perform the following algorithm:
1. You need to disconnect our bot, clear all history and completely delete the dialogue with the bot.
2. In our system, go to the Access - Messengers - Telegram section and delete all created accounts.
3. Go to your connection in the Data Receiver block at the "Access" stage and create a new account.
4. According to the help, reconfigure Telegram, only this time first create a group or channel, add our bot there and send a line with the connection there. After that, send test data to Telegram and check what came.
We would like to draw your attention!
When transferring data to Telegram, there is a limit on sending messages to the bot - 1 message every 3 seconds. For example, if you want to transfer 10 lines from the table, it will take 30 seconds.
This completes the Data Destination system setup!
Now you can start choosing the update interval and enabling auto-update.
To do this, click "Enable update".

On the main screen, click on the gear icon to select the required update interval or setup scheduled launch. To start the connection by time, select scheduled start and specify the desired time for the connection update will be started, or add several options at once when you need the connection will be started.
Attention! In order for the scheduled launch to work at the specified time, the interval between the current time and the specified time must be more than 5 minutes. For example, you select the time 12:10 and the current time is 12:08 - in this case, the automatic update of the connection will occur at 12:10 the next day. If you select the time 12:20 and the current time is 12:13 - the auto-update of the connection will work today and then every day at 12:20.
To make the current connection transmit data only after another connection, check the box "Update connection only after start other connection" and specify the connection after which the current connection will be started.


To enable auto-update, switch the slider to the position as shown in the picture.
To perform a one-time data transfer, click on the arrow icon.

This completes the setup of Telegram as a Data Destination! See how easy it is!?
Now don't worry, ApiX-Drive will do everything on its own!