The Preview Template command allows you to view a version of the template formatting and layout to ensure it is accurate.
Arguments
The Preview command requires the following arguments: Command, Realm, Password, Template Name, and Template Type.
api_web?r=myrealm&p=mypass&c=templatepreview&template_name=mytemplate&template_type=2
The command is ‘templatepreview’, the realm is ‘myrealm’ and the password is ‘mypass’. Based on the type, the HTML version of the template named 'mytemplate' will be displayed.
The Preview Template command supports the following arguments:
Name |
Req? |
Description |
Argument |
Command |
Yes |
Defines the command to use. |
cmd=templatepreview c=templatepreview |
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 | Name of the template to preview. | template_name=[template_name] | |
Template Type |
|
Format of the template to preview, where 1 is Plain Text and 2 is HTML. Mobile is not supported at this time.
|
template_type=[1,2] |
Example
Using all commands and arguments (please note the command is wrapped for display purposes only):
api_web?r=myrealm&p=mypass&c=templatepreview&template_name=mytemplate&template_type=2
Successful results return a plain text rendition of the template in a browser window:.
Results
The Preview Template command outputs either a rendition of the template or a FAILURE message.
SUCCESS
The Preview Template command does not explicitly return a Success code. Instead, it displays a rendition of the template in a browser window.
FAILURE
A Preview Template command will fail for several reasons, such as if the template does not exist. The result format is:
FAILURE: [Reason]