Follow

Create List from List Definition

The Create List from Definition command allows you to create a new List based on the properties of a List Definition.  It requires the following arguments: Command, Realm,  Password, List Name and List Definition ID.

api_web?r=myrealm&p=mypass&c=createlistfromdefinition&list_name=mylistfromdefinition&list_definition_id=2

The command is ‘createlistfromdefinition’, the realm is ‘myrealm’ and the password is ‘mypass’. The a new list named 'mylistfromdefinition' will be created with the same settings as the list definition '2'.  

Create List from Definition only supports creating lists of type Normal (type=0) or Seed (type=2).  All new lists are Normal by default.  

Example

Using all commands and arguments (please note the command is wrapped for display purposes only):

api_web?r=myrealm&p=mypass&c=createlistfromdefinition&list_name=mylist&list_definition_id=11&list_type=0

Successful results return, where ‘6’ is the ID of the new Normal type list:

SUCCESS: 6

Results

The Create List from Definition command outputs either a SUCCESS or a FAILURE message. 

SUCCESS

The Create List from Definition command success message returns the id of the new list.  The result format is:

SUCCESS: [list_id]

FAILURE

A Create List from Definition command will fail for several reasons, such as if the source list definition does not exist or an list with the same name already exists.  The result format is:

FAILURE: [Reason]  

Arguments

The Create List from Definition command supports the following arguments:

Name

Req?

Description

Argument

Command

Yes

Defines the command to use.

cmd=createlistfromdefinition

c=createlistfromdefinition

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 create. To include spaces, use + or %20 to avoid possible issues with spaces in a URL.

list_name=[list_name]

List Definition Yes Identifier of the List Definition to copy properties into the new list. list_definition_id=[id]
List Type  

Type of List to create, default is Normal if no type is defined:

0 = Normal List
2 = Seed List

type=[0,1]

 

DEFAULT==0

Feature released in v12.06.0.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk