|
Udpate Existing Campaign Reward
Update an existing campaign reward to an existing Points or Event-based 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_update |
|
Required |
|
|
|
action |
|
reward |
|
Required |
|
|
|
account_id |
|
greatwidgets |
|
Required |
|
|
|
campaign_id |
|
1234567890123456 |
|
Required |
|
|
|
reward_id |
|
57 |
|
Required |
|
|
|
new_reward_level |
|
1000 |
|
Optional |
|
|
|
new_reward_description |
|
Free Widget |
|
Optional |
|
|
|
new_reward_identifier |
|
1010101 |
|
Optional |
|
|
|
reward_custom_field_## |
|
Reward data here based on your custom reward field |
|
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:
- The ability to update rewards is based on the permissions of the user_id that is making the call.
- Only one reward can be updated at a time. Loop this call in your program to update multiple rewards at the same time.
- This call applies only to Points and Event-Based campaigns.
- The new_reward_level is an amount that is depedent on the campaign type. For example:
- For Points-based campaigns: 1000 points = Free Widget
- For Event-based campaigns: 15 events = Free Widget
- The new_reward_identifier is an optional field that lets you specify a reward id such as a SKU, used mostly for 3rd party fullfilment integrations. Please note that 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 this optional new_reward_identifier field.
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'] = 'campaign_update';
- $data['action'] = 'reward';
- $data['account_id'] = 'greatwidgets';
- $data['campaign_id'] = '1234567890123456';
- $data['reward_id'] = '1234567890123456';
- $data['new_reward_level'] = '2000';
- $data['new_reward_description'] = 'Free Other Widget';
- $data['new_reward_identifier'] = '1010102';
- $data['reward_custom_field_1'] = '7661234';
Success XML Response:
- <response status="success">
- <reward status="updated">
- <id>57</id>
- </reward>
- </response>
Note:
- A successful result will return the reward_id of the reward. This id can also be retrieved with the Campaign - List Rewards API call.
Error XML Response:
- <response status="error">
- <error>Error message</error>
- </response>
|
|