Update text content of an existing email message template API

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 HeaderDescription
content-typeapplication/json
authorizationAccess token or API Secret Key in Bearer format

Example: Bearer $(key)

Body Parameters

The following table describes the elements in the request body:

ParameterTypeMandatoryDescription
channelStringMandatorySpecifies the channel. The options are:
* email
emailTemplateObjectMandatorySpecifies the content for the email template. The parameters are:



  • format: (Optional)
    Specifies the format of the template. The format cannot be updated. The options are

    0 (only HTML).
    1 (only Text)
    * 2 (Both HTML and Text).


  • subject: (Mandatory)
    Specifies the subject line in base64 format for the email template.

  • htmlcontent: (Optional) Specifies the html content in base64 format for the template

  • textcontent: (Mandatory) Specifies the text content in base64 format for the template

  • description: (Optional) specifies the description for the template

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:

ParameterDescription
nameReturns the name of the email template that is created.
messageReturns the confirmation message.
idReturns 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 CodeCode within API ResponseDescription
400400Format type selected while template creation is: 2. For format type 2, HTML is required.",
400400I/O error on post request. Cannot retry due to server authentication, in streaming mode.
400400Text or HTML content not in Base64 encoded.
400400Invalid channel :: channel name
4002000Format type selected while template creation is: 0. For format type 0, only HTML is required, no text content required.
4002001"Format type selected while template creaton is: 1. For format type 1, only text is required, no HTML content required."
4002003Invalid format type, it will be either 0, 1 or 2.
4002004Subject content not in Base64 encoded.
4002006Text content not in base64 encoded.
400400The requested asset is not present.
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"
5001001Invalid input JSON
Language