API DOCUMENTATION Last Update: Apr 2022

Campaign Rewards List

Returns a list of the rewards available for a given campaign.

 

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 campaign_rewards Required
account_id greatwidgets Required
campaign_id 1111222233334444 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:

  • When using this call, the 'account_id' MUST be the unique Owner ID that is found in the "Edit Account Information" page reached from the main page / control panel.
  • The 'campaign_id' MUST be the unique Campaign ID that is found in the "Edit Campaign" page reached from the main page / control panel listing of campaigns.

 

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'] = 'campaign_rewards';
  4. $data['account_id'] = 'greatwidgets';
  5. $data['campaign_id'] = '1111222233334444';

 

Success XML Response:

  1. <response status="success">
  2. <campaign>
  3. <id>1111222233334444</id>
  4. </campaign>
  5. <rewards>
  6. <reward>
  7. <id>356</id>
  8. <level>1000</level>
  9. <description>Free Widget</description>
  10. </reward>
  11. <reward>
  12. <id>417</id>
  13. <level>1500</level>
  14. <description>Free Service</description>
  15. <reward_id>156739948736</reward_id>
  16. <reward_custom_field_1>7654382</reward_custom_field_1>
  17. </reward>
  18. ...
  19. </rewards>
  20. </response>

Notes:

  • When identifying the reward to the API, you MUST use the <id> that is returned in the XML construct, NOT the <reward_id> which corresponds to the optional reward_identifier field.
  • Rewards are only available for the following type of campaigns:
    • Points-based campaigns
    • Event-based campaigns
    • For Buy X Get 1 Free type campaigns, this will return the products/services previously defined to be able to be accumulated, and the number of times that item needs to be purchased before it should be available as a reward.

 

Error XML Response:

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