The Report Contacts in List command allows you to return a list of contact date.
Report Contacts in List requires the following arguments: Command, Realm, Password. List ID, and Offset.
api_web?r=myrealm&p=mypass&c=rpt_subscribers_in_list&list_id=66&offset=0
The command is ‘rpt_subscribers_in_list’, the realm is ‘myrealm’ and the password is ‘mypass’. The first 250 contacts in list with ID '66' will be returned.
Example
Using all commands and arguments (please note the command is wrapped for display purposes only):
api_web?r=myrealm&p=mypass&c=rpt_subscribers_in_list&list_id=66&offset=250
Successful results return:
"subscriber_id","email","first_name","last_name","created_date"
"23432","joe@myemail.com","Joe","Cool","2009-07-08 13:23:19"
"23675","john@myemail.com","John","Doe","2009-07-10 08:20:23"
"445755","jane@myemail.com","Jane","Doe","2012-08-30 08:20:35"
Some systems have the ability to define a unique Customer Key per contact. If your realm has Customer Key enabled, and additional column "customer_key" will be included in the results.
Results
The Report Contacts in List command outputs either the results of the search or a FAILURE message.
SUCCESS
The Report Contacts in List command does not explicitly return a Success code. Instead, it outputs the campaign details in plain text format. Use the Output Format argument to return the results in an alternate format.
FAILURE
A Report Contacts in List command will fail for several reasons, such as if the list does not exist. The result format is:
FAILURE: [Reason]
Arguments
The Report Contacts in List command supports the following arguments:
Name |
Req? |
Description |
Argument |
Command |
Yes |
Defines the command to use. |
cmd=rpt_subscribers _in_list c=rpt_subscribers _in_list |
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 ID | Yes | Identifier of the list to report. | list_id=[list_id] |
Offset | Yes | The starting point from which to return results. The maximum result for each call is 250 contacts. For example, offset=0 returns the first 250 results, and offset=250 returns the next 250 results. Offset is in multiples of 250. |
offset=[0, 250, 500, etc] |
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 |