The Get List Attribute Values command allows you to return a list of all List Attributes and values associated with a specified List.
The command requires the following arguments: Command, Realm, Password, List ID, and Output Format.
api_web?r=myrealm&p=mypass&c=listattrgetvalues&list_id=5&output_format=xml
The command is ‘listattrgetvalues', the realm is ‘myrealm’ and the password is ‘mypass’. The List Attributes for List ID ‘5’ are returned.
Example
Using listattrgetvalues with all commands and arguments (please note the command is wrapped for display purposes only):
api_web?r=myrealm&p=mypass&c=listattrgetvalues&list_id=5&output_format=xml
Successful results return:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ListAttributes>
<attribute>
<name>em_list_city</name>
<value>28</value>
</attribute>
<attribute>
<name>em_list_contactname</name>
<value>Jane Doe</value>
</attribute>
<attribute>
<name>em_list_contactemail</name>
<value>jane.doe@mydomain.com</value>
</attribute>
<attribute>
<name>em_list_store</name>
<value>28</value>
</attribute>
</ListAttributes>
Results
The Get List Attribute Values command outputs either the results of the search or a FAILURE message.
Success
The Get List Attribute Values command does not explicitly return a Success code. Instead, it outputs the data in pairs by List Attribute Name and Value. Use the Output Format argument to return the results in a specific format.
Failure
The command will fail for several reasons. The result format is:
FAILURE: [Reason]
Arguments
The command supports the following arguments:
Name |
Req? |
Description |
Argument |
Command |
Yes |
Defines the command to use. |
cmd=listattrgetvalues c=listattrgetvalues |
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 |
ID of the list to report Attributes. |
list_id=[list_id] |
Output Format |
Yes |
To specify the format of the output, use one of two arguments. |
csv=1 OR |
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 or JSON. |
headers=[0,1] DEFAULT==0 |