GET Telegram Delivery Record by UUID
This endpoint retrieves the full delivery record for a specific Telegram message by its unique identifier. Use this to check the current status of a message, retrieve the request_id needed for verification status checks, or confirm delivery at any point after sending.
Configure the API Endpoint
https://api.betatel.com/api/v1/connect-hub/telegram/{uuid}/tdr
- Method:
GET
Set Up the Headers
| Param | Value | Description |
|---|---|---|
| Content-type | application/json | Specifies the payload format. |
| x-api-key | {{x-api-key}} | API key for authorization. |
| x-account-id | {{x-account-id}} | User identifier for added security and tracking. |
URL Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| uuid | string | Yes | The unique identifier of the Telegram message, returned when the OTP was sent. |
Code Snippets
- cUrl
- Python
- Node.js
- PHP
- Java
- C#
Example - cURL
curl --location 'https://api.betatel.com/api/v1/connect-hub/telegram/01JV5V54KPYK9GB29265EQRZ2P/tdr' \
--header 'Content-Type: application/json' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'x-account-id: YOUR_ACCOUNT_ID'
Example - Python
import http.client
uuid = "01JV5V54KPYK9GB29265EQRZ2P"
conn = http.client.HTTPSConnection("api.betatel.com")
headers = {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY',
'x-account-id': 'YOUR_ACCOUNT_ID'
}
conn.request("GET", f"/api/v1/connect-hub/telegram/{uuid}/tdr", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Example - Node.js
const axios = require('axios');
const uuid = '01JV5V54KPYK9GB29265EQRZ2P';
axios.get(`https://api.betatel.com/api/v1/connect-hub/telegram/${uuid}/tdr`, {
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY',
'x-account-id': 'YOUR_ACCOUNT_ID'
}
})
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
Example - PHP
<?php
$uuid = "01JV5V54KPYK9GB29265EQRZ2P";
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.betatel.com/api/v1/connect-hub/telegram/{$uuid}/tdr",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'x-api-key: YOUR_API_KEY',
'x-account-id: YOUR_ACCOUNT_ID'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Example - Java
String uuid = "01JV5V54KPYK9GB29265EQRZ2P";
HttpResponse<String> response = Unirest.get("https://api.betatel.com/api/v1/connect-hub/telegram/" + uuid + "/tdr")
.header("Content-Type", "application/json")
.header("x-api-key", "YOUR_API_KEY")
.header("x-account-id", "YOUR_ACCOUNT_ID")
.asString();
System.out.println(response.getBody());
Example - C#
string uuid = "01JV5V54KPYK9GB29265EQRZ2P";
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, $"https://api.betatel.com/api/v1/connect-hub/telegram/{uuid}/tdr");
request.Headers.Add("x-api-key", "YOUR_API_KEY");
request.Headers.Add("x-account-id", "YOUR_ACCOUNT_ID");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Understanding the Response
{
"uuid": "01JV5V54KPYK9GB29265EQRZ2P",
"to": "+38761444555",
"code": "482910",
"status": "DELIVERED",
"request_id": "187259537046478",
"country": "Bosnia and Herzegovina",
"country_code": 387,
"network": "BH Telecom",
"timestamp": "2024-01-15T10:30:00.000Z"
}
| Field | Type | Description |
|---|---|---|
| uuid | string | Unique identifier for the Telegram message. |
| to | string | Recipient's phone number (E.164 format). |
| code | string | Verification code that was sent. |
| status | string | Current delivery status of the message (see table below). |
| request_id | string | Telegram Gateway request identifier. Use this with Check Verification Status. |
| country | string | Destination country name. |
| country_code | integer | Destination country dialing code. |
| network | string | Recipient's mobile network operator. |
| timestamp | string | ISO 8601 timestamp of when the message was created. |
Message Status Values
| Status | Description |
|---|---|
PENDING | Message accepted and queued. |
SENT | Message dispatched to the Telegram Gateway. |
DELIVERED | Message delivered to the recipient's device. |
READ | Recipient has opened the message. |
REJECTED | Code was invalid or max verification attempts exceeded. |
FAILED | Message expired, revoked, or could not be delivered. |
Error Handling
- 401 - Unauthorized: Authentication failed
- 404 - Not Found: No message found with the provided UUID
- 500 - Internal Server Error: An unexpected error occurred on the server