The Copy Template command allows you to create an exact copy of an existing template in your Realm. It requires the following arguments: Command, Realm, Password, Template Name and Destination Template Name.
api_web?r=myrealm&p=mypass&c=copytemplate&template_name=mytemplate&dst_template_name=mycopytemplate
The command is ‘copytemplate’, the realm is ‘myrealm’ and the password is ‘mypass’. The a new template named 'mycopytemplate' will be created with the same settings as the template named 'mytemplate'.
Example
Using all commands and arguments (please note the command is wrapped for display purposes only):
api_web?r=myrealm&p=mypass&c=copytemplate&template_name=mytemplate&dst_template_name=mycopytemplate
Successful results return, where ‘43’ is the ID of the new template:
SUCCESS: 43
Results
The Copy Template command outputs either a SUCCESS or a FAILURE message.
SUCCESS
The Copy Template command success message returns the id of the new template. The result format is:
SUCCESS: [template_id]
FAILURE
A Copy Template command will fail for several reasons, such as if the source template does not exist or an template with the same name already exists. The result format is:
FAILURE: [Reason]
Arguments
The Copy Template command supports the following arguments:
Name |
Req? |
Description |
Argument |
Command |
Yes |
Defines the command to use. |
cmd=copytemplate c=copytemplate |
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 copy. To include spaces, use + or %20 to avoid possible issues with spaces in a URL. |
template_name=[template_name] |
Destination Template Name | Yes | Name of the new template. | dst_template_name=[destination_ template_name] |
Feature released in v12.06.0.