Telegram Templates REST API
Telegram Templates REST API for SMSGatewayCenter APIs
Telegram Templates REST API
Use the Templates REST API to list active Telegram message templates and fetch a single template's full compose payload over HTTP. Combine it with the Send Telegram Message API so apps can pick a saved template and prefill body, media, and buttons. This endpoint accepts GET requests and returns JSON.
API Endpoint
https://unify.smsgateway.center/rest/tg/v1/templatesLegacy alias without v1 in the path is also supported: /rest/tg/templates
Authentication
Send your account userid and password as parameters, or send your account API key in the apikey request header. Telegram Chat API access must be enabled on your account.
Actions
| action | Method | Description |
|---|---|---|
list | GET | Return all active templates for the account (id, name, message type, media URL). Default when action is omitted. |
get | GET | Return one template's full compose payload (body, media, buttons, and related fields) by templateId. |
| Parameter | Required | Description | Example/Value |
|---|---|---|---|
| Authentication | |||
| userid / password | Yes* | Account credentials. Not required when using apikey header authentication. | YourUsername / ********** |
| output | Yes | Response format. Must be json. | json |
| Template Parameters | |||
| action | Optional | Defaults to list. Use get with templateId for a single template. | get |
| templateId | For get | Numeric template id owned by your account. Required when action=get. | 12 |
curl --location 'https://unify.smsgateway.center/rest/tg/v1/templates?userid=YourUsername&password=xxxxx&output=json&action=list'
curl --location 'https://unify.smsgateway.center/rest/tg/v1/templates?userid=YourUsername&password=xxxxx&output=json&action=get&templateId=12'
{
"status": "success",
"templatesList": [
{
"templateId": 12,
"templateName": "Order Confirmation",
"msgType": "text",
"mediaUrl": ""
}
],
"totalRecords": 1,
"page": 1,
"limit": 1,
"statusCode": "200",
"reason": "success"
}
{
"status": "success",
"template": {
"templateId": 12,
"templateName": "Order Confirmation",
"msgType": "text",
"body": "Hi {name}, your order #{orderId} has shipped!",
"mediaUrl": "",
"mediaPayloadJson": "",
"buttonsJson": "",
"useReplyMarkup": 0
},
"statusCode": "200",
"reason": "success"
}Depending on message type, get may also include media-specific fields such as location, contact, or poll details when they were saved on the template.
{
"status": "error",
"templatesList": [],
"statusCode": "403",
"reason": "Telegram API access is not enabled for this account."
}For action=get validation or not-found errors, the error payload uses an empty template array instead of templatesList, with status codes such as 400 or 404.
Testimonials
Why do Great Businesses Trust SMS Gateway Center?

