Pre-Existing Report: Campaign Totals
Generate a report with the campaign totals between two date ranges in the selected campaigns.
Headers
|
|
Key |
|
Value |
|
Note |
|
|
|
api_access_key |
|
user_api_key |
|
Optional |
|
   
The data to be submitted to the API is composed of the following fields:
|
|
field |
|
Example |
|
Note |
|
|
|
user_id |
|
john1970 |
|
Required |
|
|
|
user_password |
|
1959caadac9b13dcb3 |
|
Required if not included in the headers |
|
|
|
account_id |
|
greatwidgets |
|
Required |
|
|
|
type |
|
reports |
|
Required |
|
|
|
report |
|
audit_totals
or
coalition_points
or
coalition_stored_value
|
|
Required |
|
|
|
date_start |
|
2010-01-01 |
|
Required |
|
|
|
date_end |
|
2011-12-31 |
|
Optional |
|
|
|
selected_campaigns |
|
123456789012,21987654321 |
|
Required |
|
|
|
|
|
|
|
|
|
|
|
Output Format: |
|
|
|
output |
|
JSON or XML |
|
Optional. If not provided, defaults to XML |
|
|
|
callback |
|
someFunctionName |
|
Optional: JSONP format |
|
|
|
condensed |
|
yes |
|
Optional (No white space) Applies only to JSON(P) output |
|
|
|
|
|
|
|
|
|
Notes:
Example PHP Request:
If you are using PHP, the $data array would look like this:
- $data['user_id'] = 'john1970';
- $data['user_password'] = '1959caadac9b13dcb3';
- $data['account_id'] = 'greatwidgets';
- $data['type'] = 'reports';
- $data['report'] = 'audit_totals';
- $data['date_start'] = '2010-01-01';
- $data['date_end'] = '2011-12-31';
- $data['selected_campaigns'] = '123456789012,210987654321';
Success XML Response (New / Updated User):
- <response status="success">
- <campaign>
- <campaign_name>Points Program</campaign_name>
- <campaign_type>T</campaign_type>
- <earned>4,437</earned>
- <redeemed>-3,010</redeemed>
- <liability>1,427</liability>
- <monetary_equivalent>9.51</monetary_equivalent>
- <campaign_id>123456789012</campaign_id>
- </campaign>
- <campaign>
- <campaign_name>Employee Rewards</campaign_name>
- <campaign_type>T</campaign_type>
- <earned>17,988</earned>
- <redeemed>-3,598</redeemed>
- <liability>14,390</liability>
- <monetary_equivalent>191.87</monetary_equivalent>
- <campaign_id>234567890123</campaign_id>
- </campaign>
- ...
- </response>
Error XML Response:
- <response status="error">
- <error>Error message</error>
- </response>
|