Campaigns List
Returns a list of the campaigns for an account.
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 |
|
|
|
type |
|
campaigns_list |
|
Required |
|
|
|
account_id |
|
greatwidgets |
|
Required |
|
|
|
type_restrict |
|
points,
giftcard,
events,
earned,
buyx |
|
Optional |
|
|
|
|
|
|
|
|
|
|
|
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:
- When using this call, the list of campaigns returned is based on the permissions of the user_id that is making the call.
- The campaign_type parameter is optional. If it's not given, all campaign types are returned. If you want multiple campaign types, list each type separated by a comma.
Example PHP Request:
If you are using PHP, the $data array would look like this:
- $data['user_id'] = 'john1970';
- $data['user_password'] = '1959caadac9b13dcb3';
- $data['type'] = 'campaigns_list';
- $data['account_id'] = 'greatwidgets';
Success XML Response:
- <response status="success">
- <campaigns>
- <campaign>
- <id>1234567890123456</id>
- <name>Widget Rewards</name>
- <type>points</type>
- <points_ratio>5</points_ratio>
- <reward_ratio>15</reward_ratio>
- <currency>EUR</currency>
- <glyph>€</glyph>
- <created_stamp>2011-11-05 10:26:11</created_stamp>
- </campaign>
- <campaign>
- <id>2345678901234567</id>
- <name>Sales Bucks</name>
- <type>earned</type>
- <earned_per_event>4.95</earned_per_event>
- <currency>EUR</currency>
- <glyph>€</glyph>
- <created_stamp>2011-11-05 10:27:45</created_stamp>
- </campaign>
- <campaign>
- <id>3456789012345678</id>
- <name>Frequent Shopper Rewards</name>
- <type>buyx</type>
- <item>
- <id>45678</id>
- <description>Coffees and Teas</description>
- <earn_ratio>10</earn_ratio>
- ...
- </item>
- <created_stamp>2011-11-065 16:22:41</created_stamp>
- </campaign>
- ...
- </campaign>
- </response>
Notes:
There are 5 campaign types:
- points (Points-based campaigns)
- giftcard (Currency-based campaigns)
- events (Event-based campaigns
- earned (Currency earned per event campaigns)
- buyx (Buy X Get 1 Free type campaigns)
Gift Card and events-based campaigns do not have ratios to report.
Example PHP request to list ONLY Gift Cards and Points campaigns:
If you are using PHP, the $data array would look like this:
- $data['user_id'] = 'john1970';
- $data['user_password'] = '1959caadac9b13dcb3';
- $data['type'] = 'campaigns_list';
- $data['account_id'] = 'greatwidgets';
- $data['campaign_type'] = 'giftcard, points';
Success XML Response:
- <response status="success">
- <campaigns>
-
- <campaign>
- <id>2345678901234567</id>
- <name>My Stored Value Card</name>
- <type>giftcard</type>
- <created_stamp>2011-11-05 10:26:11</created_stamp>
- </campaign>
- <campaign>
- <id>1234567890123456</id>
- <name>Widget Rewards</name>
- <type>points</type>
- <points_ratio>5</points_ratio>
- <reward_ratio>15</reward_ratio>
- <created_stamp>2011-11-05 10:29:31</created_stamp>
- </campaign>
- ...
- </campaign>
- </response>
Error XML Response:
- <response status="error">
- <error>Error message</error>
- </response>
|