get https://yourapihubdomain.io/v1/message-templates?channel=email
This API is used to get the list of email message templates created using the API.
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 Header | Description |
---|---|
content-type | application/json |
authorization | Access token or API Secret Key in Bearer format Example: Bearer $(key) |
Request Example
https://yourapihubdomain.io/v1/message-templates?channel=email
Response Parameters
This API will return the following response parameters:
Parameter | Description |
---|---|
id | Returns the id of the message template |
name | Returns the name of the message template |
format | Returns the format of the message template - 0 (only HTML) - 1 (only Text) - 2 (Both HTML and Text) - 3 (AMP) [not supported in this release] |
description | Returns the subject 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 Code | Code within API Response | Description |
---|---|---|
400 | 400 | I/O error on post request. Cannot retry due to server authentication, in streaming mode. |
400 | 400 | Invalid channel :: channel name |
401 | 430 | Authorization failed. This resource is not allowed to access using this TOKEN or KEY |
401 | NA | Invalid token or Access token expired |
404 | 404 | Not found |
500 | 500 | Internal server error |
500 | 500 | Required String parameter 'channel' is not present" |