This API is used to update the text content of an email message template. The email template parameters such as subject, text, and HTML content should be provided in base64 format. This API will throw an error if you do not provide the subject and HTML content in base64 format.
Currently, this API supports only HTML and Text formats.
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.
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) |
Body Parameters
The following table describes the elements in the request body:
Parameter | Type | Mandatory | Description |
---|---|---|---|
channel | String | Mandatory | Specifies the channel. The options are: |
emailTemplate | Object | Mandatory | Specifies the content for the email template. The parameters are:
|
Request Example
{
"channel": "email",
"emailTemplate": {
"format": 2,
"subject": "Q2hlY2sgeW91ciBsYXRlc3Qgb2ZmZXJz",
"htmlcontent": "PGh0bWw+PGhlYWQ+PHRpdGxlPkNocmlzdG1hcyBPZmZlcjwvdGl0bGU+PC9oZWFkPjxib2R5PkRlYXIgJChUR19GSVJTVE5BTUUpLCBZb3UgYXJlIGVsaWdpYmxlIHRvIHVwZ3JhZGUgeW91ciBjdXJyZW50IHBsYW4gZnJvbSAkKFRHX0NVUlJFTlRQTEFOKSB0byAkKFRHX1VQR1JBREVQTEFOKS4gPC9ib2R5Pk0vaHRtbD4=",
"textcontent": "RGVhciAkKFRHX0ZJUlNUTkFNRSksIFlvdSBhcmUgZWxpZ2libGUgdG8gdXBncmFkZSB5b3VyIGN1cnJlbnQgcGxhbiBmcm9tICQoVEdfQ1VSUkVOVFBMQU4pIHRvICQoVEdfVVBHUkFERVBMQU4p",
"description": "Test email template"
}
}
Response Parameters
This API will return the following response parameters:
Parameter | Description |
---|---|
name | Returns the name of the email template that is created. |
message | Returns the confirmation message. |
id | Returns the unique Transaction ID of the operation in case of success. |
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 | Format type selected while template creation is: 2. For format type 2, HTML is required.", |
400 | 400 | I/O error on post request. Cannot retry due to server authentication, in streaming mode. |
400 | 400 | Text or HTML content not in Base64 encoded. |
400 | 400 | Invalid channel :: channel name |
400 | 2000 | Format type selected while template creation is: 0. For format type 0, only HTML is required, no text content required. |
400 | 2001 | "Format type selected while template creaton is: 1. For format type 1, only text is required, no HTML content required." |
400 | 2003 | Invalid format type, it will be either 0, 1 or 2. |
400 | 2004 | Subject content not in Base64 encoded. |
400 | 2006 | Text content not in base64 encoded. |
400 | 400 | The requested asset is not present. |
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" |
500 | 1001 | Invalid input JSON |