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