The Show Campaigns command allows you to return details about recent campaigns.
Arguments
The Show Campaigns command requires the following arguments: Command, Realm, Password, and Count.
api_web?r=myrealm&p=mypass&c=show_campaigns&count=10
The command is ‘show_campaigns’, the realm is ‘myrealm’ and the password is ‘mypass’. The command will return the 10 most recent campaigns with the campaign ID, list name, subject line, date sent, and number of recipients.
The Show Campaigns command supports the following arguments:
Name |
Req? |
Description |
Argument |
Command |
Yes |
Defines the command to use. |
cmd=show_campaigns c=show_campaigns |
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] |
Count |
Yes |
Specify the number of recent campaigns to return, where 50 is the maximum. |
count=[1 to 50] |
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 |
Example
Using all commands and arguments (please note the command is wrapped for display purposes only):
api_web?c=show_campaigns&r=myrealm&p=mypass&count=2&output_format=csv&headers=1
Successful results return:
"Campaign ID","List Name","Subject","Date","Recipients" "11","my list","my test message","09/19/12 11:53 AM","2" "10","my list","my test message","09/19/12 11:42 AM","2
Results
The Show Campaigns command outputs either the results of the search or a FAILURE message.
SUCCESS
The Show Campaigns command does not explicitly return a Success code. Instead, it outputs the campaign id, list name, subject, date sent, and number of recipients in plain text format. Use the output_format argument to return the results in an alternate format.
FAILURE
A Show Campaigns command will fail for several reasons. The result format is:
FAILURE: [Reason]