News! SmartSender.io becomes Wooxy. Read a post from the CEO Arrow
Wooxy API v.3.0

Get Telegram Message Status

The Get Message Statistics method allows you to get detailed information about a specific Telegram message by its unique identifier.

 

 

 

Important! The maximum number of Telegram messages that can be checked per request is 100.

Important! For each Telegram message, a maximum of 100 events that the contact has performed with the Telegram message are collected.

Request

POST
https://api.wooxy.com/v3/telegram/info

IMPORTANT: Do not send more than 10 concurrent API requests.

Body Example

                                        {
  "ids": [
    "YOUR_TELEGRAM_MESSAGE_ID_1",
    "YOUR_TELEGRAM_MESSAGE_ID_2", 
    "YOUR_TELEGRAM_MESSAGE_ID_3"
  ]
}
                                    

Parameters

Title Type Default Description

ids

required
array

List of messageId numbers. You can include only 100 IDs in one request.

Response

                                        {
  "result": true,
  "telegram_messages": [
    {
      "id": "YOUR_TELEGRAM MESSAGE_ID_1",
      "status": "delivered",
      "to": {
        "name": "userName",
        "email": "user@example.com"
      },
      "events": [
        {
          "event": "delivered",
          "datetime": "YYYY-MM-DD h:i:s"
        },
        {
          "event": "click", 
          "datetime": "YYYY-MM-DD h:i:s"
        },
        {
          "event":"viewed",
          "datetime": "YYYY-MM-DD h:i:s"
        }
       ]
      }
   ]
}
                                    

Parameters

Title Type Description

result

boolean

The sending status of the recipient:

  • true: The message is accepted and queued;
  • false: The message is rejected.

telegram_messages.id

string

The message unique identification number in the Wooxy system.

telegram_messages.status

string

The message unique identification number in the Wooxy system:

  • delivered: The telegram message was delivered;
  • fail: The telegram message wasn’t delivered ( if the contact unsubscribed from the bot
    through the “stop and block bot” function).

telegram_messages.to

object

An array of recipient information.

telegram_messages.to.name

string

The optional display name of the recipient

telegram_messages.to.email

string

The email address of the recipient

telegram_messages.events

array

Telegram messages statistics includes detailed information on each messages in the account.

telegram_messages.events.event

string

It shows the action that the contact has taken with the telegram message:

  • viewed: The status is assigned as soon as the user views the message;
  • delivered: The messages were delivered;
  • click: The status is assigned every time URLs have been clicked by the user.

telegram_messages.events.datetime

string

It shows the moment in time when the contact has taken an action with the telegram message.

Method Errors

                                        {
   "result": false,
   "errors": [
      "Error description text"
   ]
}
                                    
Error

“Argument ids must be an array of strings”

“Argument ids can not be empty”

“Each id must be a non-empty string”

“Ids count must be less or equal 100”

“Invalid authorization token!”

“Internal server error”

“Bad Request”

“no matches found for access token {accessToken}”

“user {id} not enabled”

“no data found for key {userId}”

“access token check failed for key\/secret $key\/$accessToken”

“Argument {argument} required”

Code Examples

PHP
                $accessToken = "YOUR_API_KEY";
$url         = 'https://api.wooxy.com/v3/telegram/info';
$body        = json_encode([
    'ids' => [
        'first-id',
        'second-id',
    ],
]);
/**
 * Request Example
 */
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
//curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_INFILESIZE, null);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Access-Token: $accessToken",
    'Content-Type: application/json',
    'Content-Length: ' . strlen($body),
]);
$result = curl_exec($ch);
if ($result === false) {
    echo 'cURL error:' . curl_error($ch) . PHP_EOL;
} else {
    echo strval($result) . PHP_EOL;
}
curl_close($ch);