Sending the messages to your contacts in telegram

Step 1. Prerequisites

1. Register at and create an Apifonica account, if you have not done so already.

2. Rent an Apifonica mobile phone number to be used for Telegram.

You can find instructions on registering Apifonica accounts and renting numbers here.

3. Send a request to to register your number for Telegram usage (mandatory step!)

After receiving confirmation from the support, your number is ready for use

Step 2. Creating the recipient’s database

You can send the messages only to the contacts, that are added to your contact list. Make the PUT request to{account_sid}/messengers/telegram/{number}/contacts with all the numbers from your list (Details - in the article Add contacts to Telegram number).

In one request you are adding to the contact list of your recipients and checking the presence in Telegram. All the contacts that have an account in Telegram will be added and all, that are not present, will be listed in error array:

  "status_code": 200,
  "status_message": "OK",
  "errors": [

Step 3. Sending the message to telegram

Make the POST request to{accountSID}/messages choosing "channel": "telegram" parameter.

The following cURL example demonstrates sending a message with GIF content to Telegram:

curl –X POST ‘{accountSID}/messages’ \
-H ‘Content-Type: application/json’ \
-d ‘{ \
  "from": "35315313424", \
  "to": "447860041755", \
  "channel": "telegram", \
  "type": "gif", \
  "url": "", \
  "text": "Apifonica API provides a really cool SMS messaging service" \
}' \
-u {accountSID}:{authToken}

By visiting the Apifonica website you agree with our use of cookies. Read our Cookie Policy here.