Follow

Get List

The Get List commands allow you to return the properties of a list specified by ID or name.  The command returns the list id, name, description, default template, from, reply to, bounce address, and tracking setting for clicks and opens of each list.  The commands require the following arguments: Command, Realm, Password, and either List name or List ID.

api_web?r=myrealm&p=mypass&c=getlistbyid&list_id=42

The command is ‘getlistbyid’, the realm is ‘myrealm’, the password is ‘mypass’, and the ID is '42'.

api_web?r=myrealm&p=mypass&c=getlistbyname&list_name=mylist

The command is ‘getlistbyname’, the realm is ‘myrealm’, the password is ‘mypass’, and the name is 'mylist'.

Example

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

api_web?r=myrealm&p=mypass&c=getlistbyid&list_id=42&output_format=csv&headers=1&version=8.4.0

Successful results return:

"List ID","List Name","Description","Template","From Address","Reply To Address","Bounce Address","Track Clicks","Track Opens","Folder ID" "42","mylist","test_list","42","from@domain.com","replyto@domain.com","bounce@domain.com","1","1","0"

If not output format is defined, plain results return:

"List ID","List Name"
"42","mylist"

Results

The Get List commands output either the results of the search or a FAILURE message. 

SUCCESS

The Get List commands do not explicitly return a Success code.  Instead, it outputs the list data.  Use the Output Format argument to return the results in a specific format. 

FAILURE

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

FAILURE: [Reason]  

Arguments

The Get List commands support the following arguments:

Name

Req?

Description

Argument

Command

Yes

Defines the command to use.

cmd=[getlistbyid, getlistbyname]

c=[getlistbyid, getlistbyname]

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 Yes Name or ID of the list 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_name=[list_name]

or

list_id=[list_id]

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

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

Comments

Powered by Zendesk