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

ParameterRequiredDescriptionDefault
contacts
contacts

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

N/A

REQUEST EXAMPLE

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

curl -X PUT https://msapi.apifonica.com/v2/accounts/{account_sid}/messengers/telegram/{number}/contacts \
-H 'Content-Type: application/json' \
-d '{
      "contacts": ["358123456789","358987654321"]
    }' \
-u {msapi_number_sid}:{msapi_token}

Successful response example

{
  "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
}