API DOCUMENTATION Last Update: Apr 2022

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:

  1. $data['user_id'] = 'john1970';
  2. $data['user_password'] = '1959caadac9b13dcb3';
  3. $data['type'] = 'campaigns_list';
  4. $data['account_id'] = 'greatwidgets';

 

Success XML Response:

  1. <response status="success">
  2. <campaigns>
  3. <campaign>
  4. <id>1234567890123456</id>
  5. <name>Widget Rewards</name>
  6. <type>points</type>
  7. <points_ratio>5</points_ratio>
  8. <reward_ratio>15</reward_ratio>
  9. <currency>EUR</currency>
  10. <glyph></glyph>
  11. <created_stamp>2011-11-05 10:26:11</created_stamp>
  12. </campaign>
  13. <campaign>
  14. <id>2345678901234567</id>
  15. <name>Sales Bucks</name>
  16. <type>earned</type>
  17. <earned_per_event>4.95</earned_per_event>
  18. <currency>EUR</currency>
  19. <glyph></glyph>
  20. <created_stamp>2011-11-05 10:27:45</created_stamp>
  21. </campaign>
  22. <campaign>
  23. <id>3456789012345678</id>
  24. <name>Frequent Shopper Rewards</name>
  25. <type>buyx</type>
  26. <item>
  27. <id>45678</id>
  28. <description>Coffees and Teas</description>
  29. <earn_ratio>10</earn_ratio>
  30. ...
  31. </item>
  32. <created_stamp>2011-11-065 16:22:41</created_stamp>
  33. </campaign>
  34. ...
  35. </campaign>
  36. </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:

  1. $data['user_id'] = 'john1970';
  2. $data['user_password'] = '1959caadac9b13dcb3';
  3. $data['type'] = 'campaigns_list';
  4. $data['account_id'] = 'greatwidgets';
  5. $data['campaign_type'] = 'giftcard, points';

 

Success XML Response:

  1. <response status="success">
  2. <campaigns>
  3. <campaign>
  4. <id>2345678901234567</id>
  5. <name>My Stored Value Card</name>
  6. <type>giftcard</type>
  7. <created_stamp>2011-11-05 10:26:11</created_stamp>
  8. </campaign>
  9. <campaign>
  10. <id>1234567890123456</id>
  11. <name>Widget Rewards</name>
  12. <type>points</type>
  13. <points_ratio>5</points_ratio>
  14. <reward_ratio>15</reward_ratio>
  15. <created_stamp>2011-11-05 10:29:31</created_stamp>
  16. </campaign>
  17. ...
  18. </campaign>
  19. </response>

Error XML Response:

  1. <response status="error">
  2. <error>Error message</error>
  3. </response>