Telegram Gateway Authorization Codes#

This section describes the specifics of transmitting authorization codes through the platform to Telegram Gateway.

To transmit a code, send a request including the corresponding code. The code (without any additional text) will be passed to the operator, who will insert it into the message template.

More details

The Telegram Gateway service is designed to deliver authorization and verification digital codes to Telegram Messenger users.

Codes are sent from the Verification Codes official channel.

Hiding one's phone number in Telegram settings does not affect message delivery. The delivery of codes is also unaffected by whether the user has a Telegram Premium subscription or not.

Currently, the service supports:

  • sending authorization code messages via Telegram;
  • receiving message delivery statuses;
  • cascading message sending to alternative channels in case of non-delivery to Telegram (if necessary).

Sending Request#

 1 {
 2   "login": "YOUR_LOGIN",
 3   "password": "YOUR_PASSWORD",
 4   "useTimeDiff": true,
 5   "id": "superId",
 6   "shortenLinks": false,
 7   "scheduleInfo": {
 8     "timeBegin": "10:00",
 9     "timeEnd": "12:00",
10     "weekdaysSchedule": "123"
11   },
12   "destAddr": "SUBSCRIBER'S_PHONE_NUMBER",
13   "message": {
14     "type": "TGCODE",
15     "data": {
16       "text": "12345",
17       "serviceNumber": "SENDER'S_NAME",
18       "ttl": 120,
19       "ttlUnit": "SECONDS"
20     }
21   }
22 }

Response#

After sending a message the Service Provider returns a response synchronously.

Successful Sending#

In case of successful sending the Service Provider returns the 200 OK HTTP-code.

1  {
2     "mtNum": "7390612217"
3     "id": "8770630"
4  }

Sending Errors#

For results with errors, a response HTTP code will differ from 200 (see Error Codes).

1 {
2     "error": {
3         "code": 4,
4         "description": "Invalid request"
5     },
6     "extendedDescription": "В сообщении отсутствует код"
7 }

In this example, the Telegram message does not contain a digital authorization code.

Error Codes#

Code

Description

HTTP-code

1

Service is unavailable

503

2

Invalid IP-address

403

3

Too many connections

429

4

Invalid request

400

5

Invalid login

401

6

Invalid password

401

7

serviceNumber is not defined

400

8

destAddr is not correct

406

9

Message type is not correct

406

10

Prohibited sending duplicates

409

11

Invalid TTL

406

100

100

500

Delivery Statuses#

To receive message statuses, you need to set up the Delivery Status Service.

Delivery Error Codes#

Delivery error codes for each message type are provided in the corresponding tab of the Description of Error Codes (parameter status=5) section.