Skip to main content

POST Telegram TDRs

This endpoint returns a paginated list of Telegram Delivery Records (TDRs) for your account. Use it to browse message history, filter by status or recipient, and sort results by any record field.

Configure the API Endpoint

https://api.betatel.com/api/v1/connect-hub/telegram/tdr
  • Method: POST

Set Up the Headers

ParamValueDescription
Content-typeapplication/jsonSpecifies 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.

Craft the Request Body

Example of body
{
"page": 1,
"rows_per_page": 20,
"sort_by": "timestamp",
"sort_direction": "DESC",
"filter": {
"status": "DELIVERED"
}
}
FieldTypeRequiredDescription
pageintegerNoPage number to retrieve, starting from 1 (default: 1).
rows_per_pageintegerNoNumber of records per page, between 1 and 100 (default: 20).
sort_bystringNoField name to sort results by (e.g. "timestamp", "status", "to").
sort_directionstringNoSort order: "ASC" or "DESC".
filterobjectNoOptional filter criteria applied to the result set (e.g. filter by status or to).

Code Snippets

Example - cURL
curl --location 'https://api.betatel.com/api/v1/connect-hub/telegram/tdr' \
--header 'Content-Type: application/json' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'x-account-id: YOUR_ACCOUNT_ID' \
--data '{
"page": 1,
"rows_per_page": 20,
"sort_by": "timestamp",
"sort_direction": "DESC",
"filter": {
"status": "DELIVERED"
}
}'

Understanding the Response

{
"page": 1,
"rows_per_page": 20,
"sort_by": "timestamp",
"sort_direction": "DESC",
"total": 243,
"total_pages": 13,
"has_next_page": true,
"has_previous_page": false,
"list": [
{
"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"
}
]
}

Pagination fields:

FieldTypeDescription
pageintegerThe current page number.
rows_per_pageintegerNumber of records returned per page.
sort_bystringThe field results are sorted by.
sort_directionstringThe sort direction (ASC or DESC).
totalintegerTotal number of records matching the filter.
total_pagesintegerTotal number of pages available.
has_next_pagebooleanWhether a next page exists.
has_previous_pagebooleanWhether a previous page exists.

TDR record fields:

FieldTypeDescription
uuidstringUnique identifier for the message.
tostringRecipient's phone number (E.164 format).
codestringVerification code that was sent.
statusstringCurrent delivery status (see table below).
request_idstringTelegram Gateway request identifier.
countrystringDestination country name.
country_codeintegerDestination country dialing code.
networkstringRecipient's mobile network operator.
timestampstringISO 8601 timestamp of when the message was created.

Message Status Values

StatusDescription
PENDINGMessage accepted and queued.
SENTMessage dispatched to the Telegram Gateway.
DELIVEREDMessage delivered to the recipient's device.
READRecipient has opened the message.
EXPIREDMessage expired before delivery was confirmed.
REVOKEDVerification was explicitly revoked.
FAILEDMessage could not be delivered.

Error Handling

  • 400 - Bad Request: Invalid pagination parameters or malformed filter
  • 401 - Unauthorized: Authentication failed
  • 500 - Internal Server Error: An unexpected error occurred on the server