Docs

Add contacts to Telegram number

https://msapi.apifonica.com/v2/accounts/{account_sid}/messengers/telegram/{number}/contacts

Overview

API method for contacts addition is a PUT request to /v2/accounts/{account_sid}/messengers/telegram/{number}/contacts.

This request allows to add your number to the contact list of all customers that have Telegram account. If the customer doesn't have Telegram account you'll receive an error.

Input parameters

Parameter

Default

Description

Value

contacts

N/A

Array of users phone numbers to be added to account contacts;

N/A

Value

existing application SID

Description

Array of users phone numbers to be added to account contacts;

Default value

default_call_app_sid

Request example

The following JSON example demonstrates adding your number to the contact list of the numbers from the array:

https://msapi.apifonica.com/v2/accounts/{account_sid}/messengers/telegram/{number}/contacts
{
    "contacts": ["358123456789","358987654321"]
}

Successful response example

All numbers that have accounts in Telegram are added, all numbers that don't have accounts are listed in "errors" array:

{
    "status_code": 200,
    "status_message": "OK",
    "errors": [
        "358987654321"
    ]
}

Unsuccessful response examples

{
   "error":"Invalid params: Contacts (zero value)",
   "request_id":"7f4d9823-fd41-4697-ba9b-11940e7932d0",
   "status_code":400
}
{
   "error":"Malformed json",
   "request_id":"7f4d9823-fd41-4697-ba9b-11940e7932d0",
   "status_code":400
}