Create a Telegram App

To connect the Telegram App Chat Gateway to Webitel, you have to do the following:

1. Have a Telegram account registered to a phone number.

How to register Telegram App can be found here.

2. Log in to the site https://my.telegram.org.

3. Go to API development tools. Fill out the form and click the Create application button (Fig.1).

Fig. 1. Create application

The configuration page opens. The following parameters are taken from here (Fig. 2):

  • API id

  • API hash

Fig. 2. Configuration

5. Go to Webitel – Admin, Chat Gateways page, and create a new Chat Gateway by selecting Telegram App (Fig.3).

Fig. 3. New chat gateway modal window

6. Fill in the fields  (Fig. 4) using the previously obtained data (see point 4).

Fig. 4. Telegram App tab

7. Click the Save button. The Sign in to Telegram button appears (Fig. 5).

Fig. 5. Sign in to Telegram

8. Click the Sign in to Telegram button and log in to Telegram (the same phone number as point 2).

Fig. 6. Login to Telegram

Fig. 7. Sign in to Telegram

9. After a successful login, the Logout button and the name of the Telegram account are displayed.

The Templates tab is used for additional settings of system notifications in the chat.

10. Go to the Chat Gateways page and enable the newly created text gateway using the State switch (Fig. 8).

Fig. 8. Enable Chat Gateway

The Chat Gateway is created, connected, and enabled.

11. Create a Flow on the Flow page with the Broadcast message component (Fig. 9) through which outgoing messages will go.

Fig. 9. Flow

Peer - ${destination} – it is a variable of the phone number of Members in a Queue.

Chat Gateway profile - it is Chat Gateway created earlier (points 5-10). Click the Add button after selecting the Chat Gateway.

Click the Save button.

12. Go to the Queues page, click the Add button, and create an Outbound task queue (Fig.10).

Fig. 10. Create an Outbound task queue

The General tab opens (Fig.11) after clicking the Create button.

13. Fill in the required fields. In the Flow schema field, select the Flow created earlier (point 11).

Fig. 11. General tab

Click the Save button. Go to the Queues page.

14. Open this queue's Members page and create Members who will receive messages.