Get SMS message templates list created using API - Beta

This API is used to get the list of all SMS message templates created using the API. If you want to get a specific SMS message template, you can pass the template id in the URI.

📘

Know your endpoint

Based on the domain you use to log in to Webex Campaign, the endpoint domain for your API varies. For more information, refer to the Know Your API Endpoints section.

📘

Currently this API returns all the templates. However, in future releases we will update this API to return limited templates. To get the full list, you can pass the start position and limit in query params in the header.

Headers

The following table describes the request headers:

Request HeaderDescription
content-typeapplication/json
authorizationAccess token or API Secret Key in Bearer format

Example: Bearer $(key)

Request Example



https://yourapihubdomain.io/v1/message-templates?channel=sms

https://yourapihubdomain.io/v1/message-templates/16715338090115?channel=sms

Response Example

[
    {
        "name": "SMSTemplate_December_offers",
        "id": "16715338090115",
        "content": "$(TG_CELL_CODENUMBR){asset_links_16444922470106}{{at_personalizedContentLink}}",
        "description": "SMSTemplate_December_offers",
        "personalizationSource": 1,
        "targetName": "null",
        "masterTemplateId": "16715200310052",
        "createdOn": "20/Dec/2022 16:26",
        "createdBy": "1582274979811",
        "status": "1"
    },
    {
        "name": "SMSTemplate_November_offers",
        "id": "16715334900113",
        "content": "$(TG_CELL_CODENUMBR){asset_links_16444922470106}{{at_personalizedContentLink}}",
        "description": "null",
        "personalizationSource": 0,
        "targetName": "null",
        "masterTemplateId": "null",
        "createdOn": "20/Nov/2022 16:21",
        "createdBy": "1582274979811",
        "status": "1"
    },
    {
        "name": "SMSTemplate_October_offers",
        "id": "16715334500112",
        "content": "$(TG_CELL_CODENUMBR){asset_links_16444922470106}{{at_personalizedContentLink}}",
        "description": "null",
        "personalizationSource": 0,
        "targetName": "null",
        "masterTemplateId": "16715200310052",
        "createdOn": "20/Oct/2022 16:20",
        "createdBy": "1582274979811",
        "status": "1"
    }
  ]

Response Parameters

This API will return the following response parameters:

ParameterDescription
idReturns the id of the message template
nameReturns the name of the message template
contentReturns the content of the message template
descriptionReturns the description
personalizationSourceReturns the status whether the personalization is enabled or not.
targetnameReturns the target group name
masterTemplateIdReturns id of the master template
createdOnReturns the template created date
createdByReturns the id of the API user who created the template.
statusReturns the status of the message template

Failure Response Codes

The API will return code within the response as per the following table in case of failure scenarios.

HTTP Status CodeCode within API ResponseDescription
400400I/O error on post request. Cannot retry due to server authentication, in streaming mode.
400400Invalid channel :: channel name
401430Authorization failed. This resource is not allowed to access using this TOKEN or KEY
401NAInvalid token or Access token expired
404404Not found
500500Internal server error
500500Required String parameter 'channel' is not present"
Language