To set up Custom Notifications from Crowdin Enterprise in Telegram, follow the steps below.
Creating Telegram Account
If you don’t have a Telegram account already, you will need to connect with a phone. Telegram uses your phone number as a primary credential which you’ll use to log into your account. So firstly, download and install the Telegram app using Android or iOS. Once signed up, you may use the Telegram web interface with a PC or Mac to simplify further configurations, but this part is up to you.
Creating Telegram Bot
To receive notifications in Telegram, you need to create a bot.
Read more about creating a Telegram bot.
Once finished, you will be provided with a bot’s API token. Make sure to save it; you’ll need it later.
Configuring Telegram Channel
The next step is to create a public Telegram channel which will be used to get notifications from Crowdin Enterprise. Later you’ll be able to change the channel’s privacy if needed.
To create a Telegram channel, follow these steps:
- Open Telegram on your device.
- Click on the pen icon and select New Channel.
- Name your channel in the Channel name field.
- (Optional) Specify a channel description.
- (Optional) Click on the camera icon to set a display picture for your channel.
- Click Next in the top-right corner.
- Select Public channel type.
- Specify a permanent link for your channel. This link is what people would use to search and join your channel.
- Click Next in the top-right corner.
- (Optional) In this step, Telegram will ask you to add subscribers to your Telegram channel. Select contacts you’d like to add, including your new bot (provide your bot with Admin permissions). You can choose not to add any members for now since you’ll be able to do it later.
- Click Next in the top-right corner to continue and create your channel on Telegram.
Configuring Custom notifications in Crowdin Enterprise
- Open your Account Settings > Notifications.
- Click Custom notifications.
-
In the appeared dialog, specify the URL in the following format:
https://api.telegram.org/bot{bot_API_token}/sendMessage
Note: Make sure to replace {bot_API_token} with your actual Telegram bot API token.
- Select application/json for the Content type.
-
Paste the following payload in the Payload field:
{
"chat_id": "{public_chat_id}",
"text": "{{notification-message}}"
}
where {public_chat_id}
– Your public chat id you specified for your channel link during the Telegram channel configuration.
- Click Test notification to receive a test message from Crowdin Enterprise to your Telegram channel.
- Una volta finito con la configurazione, clicca Salva.
Changing Telegram Channel Type
If you’d like to make your Telegram channel private and keep receiving notifications from Crowdin Enterprise, follow these steps:
-
First of all you need to acquire your Telegram channel’s original chat id by visiting: https://api.telegram.org/bot{bot_API_token}/sendMessage?chat_id={public_chat_id}&text=Test
Note: Make sure to replace {bot_API_token} and {public_chat_id} with your actual Telegram bot API token and public chat id.
-
You’ll get a response in a JSON format that will contain your Telegram channel’s original chat id. ![JSON response](/assets/docs/custom_notifications_telegram_json_response.png)
- Open your Account Settings > Notifications.
- Click Custom notifications.
- In the appeared dialog, modify the URL by replacing the chat id with the one received in the JSON response above.
- Click Save.
- In Telegram, open your channel.
- Click on your channel name and click Edit.
- Click Channel Type.
- Select Private and click Done.
Vedi Anche