Follow

Get List Attributes

The Get List Attributes command allows you to return a list of all List Attributes in an Account. 

The command requires the following arguments: Command, Realm, Password and Output Format.

api_web?r=myrealm&p=mypass&c=listattrgetnames&output_format=xml

The command is ‘listattrgetnames', the realm is ‘myrealm’ and the password is ‘mypass’.  

Example

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

api_web?r=myrealm&p=mypass&c=listattrgetnames&output_format=xml

Successful results return:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  <ListAttributes>
    <attribute>
      <listAttributeName>em_list_city</listAttributeName>
      <listAttributeId>28</listAttributeId>
    </attribute>
</ListAttributes>

Results

The Get List Attribute command outputs either the results of the search or a FAILURE message. 

Success

The Get List Attribute command does not explicitly return a Success code.  Instead, it outputs the data in pairs of listAttributeName and listAttributeID.  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=listattrgetnames

c=listattrgetnames

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]

Output Format

 Yes

To specify the format of the output, use one of two arguments.  

csv=1 OR
output_format=[csv,csv_tab, csv_pipe,xml,json]

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

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

Comments

Powered by Zendesk