The Update Template command allows you to change the subject and content of an existing template. The command allows you to specify several components of a template, such as Subject and Body. Use POST to send large blocks of template body data. More advanced control of the Template properties, such as Content Encoding, must be set through the web interface or WebServices API where available.
Arguments
The updatetemplate command requires the following arguments: Command, Realm, Password, and Template Name.
api_web?r=myrealm&p=mypass&c=updatetemplate&template_name=My+Template
The command is ‘updatetemplate’, the realm is ‘myrealm’ and the password is ‘mypass’, and name is ‘My Template’.
An important note about the Update command is that if you do not include an argument, the content in that field will be cleared. If you do not wish to clear your template content, be sure to include all commands and the content you expect to be saved.
The Update Template command supports the following arguments:
Name |
Req? |
Description |
Argument |
Command |
Yes |
Defines the command to use. |
cmd= updatetemplate c=updatetemplate |
Realm |
Yes |
Name of the realm to run the command. This is required, and the command will fail if the realm and password do not match. |
realm= [realm_name] r=[realm_name] |
Password |
Yes |
Authentication code for API access. This is required, and the command will fail if the realm and password do not match. |
pwd=[password] p=[password] |
Template Name |
Yes |
Name of the template to update. To include spaces, use + or %20 to avoid possible issues with spaces in a URL. |
template_name= [template_name] |
Subject |
|
Subject Line of the message to send. This field has a limit of 48 characters. |
template_subject=[text] |
Plain Body |
|
Plain-Text content to send. |
template_body_ plain=[text] |
HTML Body |
|
HTML content to send. |
template_body_ html=[text] |
Character Set |
|
If the content of the template included Unicode characters, set the Charset to utf-8. |
charset=[utf-8] DEFAULT==none |
Character Encoding |
|
When the message is sent, the characters will be encoded either in Base-64 format or Quoted-Printable, depending on the option selected. |
encoding= [default,base64, quoted] DEFAULT==default |
Folder | Identifier of the Folder to associate the Creative for organization. Default folder is 0, or Unfiled. | folder_id=[folder_id] |
Example
Using all commands and arguments (please note the command is wrapped for display purposes only):
api_web?r=myrealm&p=mypass&c=updatetemplate&template_name=mytemplate&template_subject=My%20Subject%20Line&template_body_plain=this%20is%20a%20Plain%20test%20updated&template_body_html=this%20is%20an%20HTML%20test%20updated&folder_id=0
Successful results return, where ‘42’ is the ID of the updated template:
SUCCESS: 42
This is a very simple example. You can also POST the values, which allows you to send much larger template body data.
Results
The Update Template command outputs either a SUCCESS or FAILURE message.
SUCCESS
The Update Template command success message returns the id of the template. The result format is:
SUCCESS: [template_id]
FAILURE
A Update Template command will fail if invalid data is defined. The result format is:
FAILURE: [Reason]