Follow

Get Lists from List Definition

**Coming end of January 2018**

 

The Get Lists from List Definitions command allows you to return a list of all Lists created based off the properties of the List Definitions specified.  This command returns the list id and name of each list created from the definition, sorted alphabetically by list id.   Get Lists from List Definitions requires the following arguments: Command, Realm, Password, and either List Definition name or ID.

api_web?r=myrealm&p=mypass&c=getlistsfromdefinition&list_definition_id=42

The command is ‘getlistsfromdefinition’, the realm is ‘myrealm’ and the password is ‘mypass’ and definition with id 42 is returned.

Example

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

api_web?r=myrealm&p=mypass&c=getlistsfromdefinition&list_definition_id=10&output_format=csv&headers=1

Successful results return:

"List Definition ID","List Definition Name","List ID","List Name"  
"10","mylistdefinition","11","mylist_1"
"10","mylistdefinition","12","mylist_2"
"10","mylistdefinition","13","mylist_3"

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

api_web?r=myrealm&p=mypass&c=getlistsfromdefinition&list_definition_name=automationdefinition&output_format=csv&headers=1

Successful results return:

"List Definition ID","List Definition Name","List ID","List Name"  
"15","automationdefinition","16","welcome"
"15","automationdefinition","23","welcome_1"
"15","automationdefinition","28","welcome_2"

Results

The Get Lists from List Definition command outputs either the results of the search or a FAILURE message. 

Success

The Get Lists from List Definition command does not explicitly return a Success code.  Instead, it outputs the list information in plain text format.  Use the output_format argument to return the following data in an alternate format. 

"List Definition ID","List Definition Name","List Id","List Name" 

Failure

A Get Lists from List Definition command will fail for several reasons.  The result format is:

FAILURE: [Reason]  

Arguments

The Get Lists from List Definition command supports the following arguments:

Name

Req?

Description

Argument

Command

Yes

Defines the command to use.

cmd=getlistsfromdefinition

c=getlistsfromdefinition

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 Identification  Yest

Name or ID of the list definition to display.  If there are spaces in the name, you can replace the space with + or %20 to avoid possible issues with spaces in a URL.

list_definition_name=[list_definition_name]

or

list_definition_id=[list_definition_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

*Feature released in v13.0.0.

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

Comments

Powered by Zendesk