The Show Global Optouts command allows you to return all contacts that are opted out globally from all lists in the realm, regardless of origin of the event. The Show Global Optouts command requires the following arguments: Command, Realm, Password, and Days.
api_web?r=myrealm&p=mypass&c=show_optglobal&days=7
The command is ‘show_opt’, the realm is ‘myrealm’, the password is ‘mypass’ and will return the email address for contacts with global optouts that occurred in the last 7 days.
Example
Using all commands and arguments (please note the command is wrapped for display purposes only):
api_web?c=show_optglobal&r=myrealm&p=mypass&days=30&output_format=csv&headers=1
Successful results return:
"Email" "jane.doe@mydomain.com" "john.doe@mydomain.com" "joe.doe@mydomain.com"
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 Show Global Optout command outputs either the results of the search or a FAILURE message.
Success
The Show Global Optout command does not explicitly return a Success code. Instead, it outputs the email address of contact in plain text format. Use the output_format argument to return the results in an alternate format.
Failure
A Show Global Optout command will fail for several reasons. The result format is:
FAILURE: [Reason]
Arguments
The Show Global Optouts command supports the following arguments:
Name |
Req? |
Description |
Argument |
Command |
Yes |
Defines the command to use. |
cmd=show_optglobal c=show_optglobal |
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] |
Days | Yes | To limit the results, specify a number of days to search. For example, to see all optouts in the past year, use the number '365' | days=[number] |
Output Format |
|
To specify the format of the list output, use one of two arguments. Default output is an unquoted plain text string. Output for this command is only one column so commas, tabs and pipes are not used. Arguments csv=1 or output_format=csv will return quoted email addresses. |
csv=1 or output_format=[csv,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 |