The Get Labels command allows you to view a list of Labels used to tag items in your Realm. The get command requires the following arguments: Command, Realm, Password and Output Format.
api_web?r=myrealm&p=mypass&c=getemaillabels&output_format=csv
The command to Get Labels is 'getemaillabels', the realm is 'myrealm', the password is 'mypass', and the format of the returned data is 'csv', returning a list of all Labels in the Realm, including the default Labels.
Example
Using 'getemaillabels' with all commands and arguments:
api_web?r=myrealm&p=mypass&c=getemaillabels&output_format=csv&headers=1
Successful results return:
"ID","Label"
"43","anniversary"
"44","birthday"
"45","daily"
"46","loyalty"
"47","monthly"
"48","newsletter"
"49","promotional"
"50","reengagement"
"52","survey"
"51","transactional"
"53","weekly"
"54","welcome"
Results
The Get Labels command outputs either the results of the search or a FAILURE message.
Success
The command does not explicitly return a Success code. Instead, it outputs the ID, Name, and Description of each Label. Use the Output Format argument to return the results in an alternate format.
Failure
The command will fail if an Output Format is not specified or invalid data is defined. The result format is:
FAILURE: [Reason]
Arguments
This command supports the following arguments:
Name | Req? | Description | Argument |
Command | Yes |
Defines the command to use. |
cmd=getemaillabels c=getemaillabels |
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 list output, use one of two arguments. |
csv=1 OR output_format=[xml,json,csv,csv_tab,csv_pipe] |
Header |
To define the data with a label, use the Header argument. This argument does not affect the XML or JSON output formats. |
headers=[0,1] DEFAULT==0 |
*Feature released in v15.15.0