The Show Templates command allows you to return a list of Templates in your realm. This command returns the template id and name of each template in the realm, sorted alphabetically by template name.
Arguments
It requires the following arguments: Command, Realm, and Password.
api_web?r=myrealm&p=mypass&c=show_templates
The command is ‘show_templates’, the realm is ‘myrealm’ and the password is ‘mypass’.
The Show Templates command supports the following arguments:
Name |
Req? |
Description |
Argument |
Command |
Yes |
Defines the command to use. |
cmd=show_templates c=show_templates |
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] |
Version | Version of API to use. Data may be added to newer versions of the API. To alleviate issues for users who have already coded file parsing, new columns are only displayed if the version is included. |
version=[version_number] 8.4.0 = folder_id |
|
Output Format |
|
To specify the format of the list output, use one of two arguments. If no argument is included, the default output is space-delimited plain text string, which may not include all data columns.
|
csv=1 or output_format=[csv,csv_tab, csv_pipe,xml] |
Header |
|
To define the data with a label, use the Header argument. This can only be used in conjunction with the output format, and does not affect XML. |
headers=[0,1] DEFAULT==0 |
Example
Using all commands and arguments (please note the command is wrapped for display purposes only):
api_web?r=myrealm&p=mypass&c=show_templates&version=8.4.0&output_format=csv&headers=1
Successful results return:
"Template ID","Template Name","Folder ID" "1","Template A","3" "2","Template B","0" "3","Template C","2" "4","Template D","0"
Results
The Show Templates command outputs either the results of the search or a FAILURE message.
SUCCESS
The Show Templates command does not explicitly return a Success code. Instead, it outputs the template id and name in plain text format. Use the Output Format argument to return the results in an alternate format.
FAILURE
A Show Templates command will fail for several reasons. The result format is:
FAILURE: [Reason]