|
Create New Campaign Promotion
Add a new promotion to an existing Points-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_new |
|
Required |
|
|
|
action |
|
promo |
|
Required |
|
|
|
account_id |
|
greatwidgets |
|
Required |
|
|
|
campaign_id |
|
1234567890123456 |
|
Required |
|
|
|
promo_operation |
|
x or + |
|
Required |
|
|
|
promo_amount |
|
1.25 or 100 |
|
Required |
|
|
|
promo_description |
|
Pre-booking bonus |
|
Required |
|
|
|
promo_custom_id |
|
XFA-275 |
|
Optional |
|
|
|
promo_start_date |
|
2013-08-01 00:00:00 |
|
Optional |
|
|
|
promo_end_date |
|
2013-08-15 23:59:59 |
|
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 create promotions is based on the permissions of the user_id that is making the call.
- The promo_amount is based on the promo_operation chosen:
- The "x" operation is a multiplier, so the promo_amount given will multiply the amount of points earned. For example:
- A value of "1.25" is equivalent to adding 25% more points (100pts becomes 125pts)
- A value of "0.5" is quivlaent to having the amount of points earned (100pts becomes 50pts)
- The "+" operation adds the promo_amount to the points earned. For example:
- A value of "100" will add 100 points to the amount of points earned.
- A value of "-50" will subtract 50 points from the amount of points earned.
- The promo_description is required in order to properly show some decriptive text in lists of promotions.
- Only one promotion can be added at a time. Loop this call in your program to add multiple promotions at the same time.
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_new';
- $data['action'] = 'promo';
- $data['account_id'] = 'greatwidgets';
- $data['campaign_id'] = '1234567890123456';
- $data['promo_operation'] = 'x';
- $data['promo_amount'] = '1.25';
- $data['promo_description'] = 'Pre-booking bonus (25%)';
Success XML Response:
- <response status="success">
- <campaign>
- <promo>
- <id>14</id>
- </promo>
- </campaign>
- </response>
Note:
- A successful result will return the promo_id of the promotion. This id can also be retrieved with the Campaign - List Promotions API call.
Error XML Response:
- <response status="error">
- <error>Error message</error>
- </response>
|
|