|
Campaign Promotions List
Returns a list of the promotions available for a given campaigns.
The data to be submitted to the API is composed of the following fields:
|
|
field |
|
Example |
|
Note |
|
|
|
API |
|
1.5 |
|
Required |
|
|
|
user_id |
|
john1970 |
|
Required |
|
|
|
user_api_key |
|
1959caadac9b13dcb3 |
|
Required |
|
|
|
account_id |
|
greatwidgets |
|
Required |
|
|
|
type |
|
campaign_promos |
|
Required |
|
|
|
campaign_id |
|
1111222233334444 |
|
Required |
|
|
|
|
|
|
|
|
|
|
|
searchField |
|
promotion or
operation
multiplier
|
|
Optional |
|
|
|
searchOper |
|
eq (equal)
ne (not equal)
bw (begins with)
bn (does not begin with)
ew (ends with)
en (does not end with)
cn (contains)
nc (does not contain)
nu (is null/empty)
nn (is not null/empty)
in (is in - comma-separated list)
ni (is not in - comma-separated list)
|
|
Optional |
|
|
|
searchValue |
|
Double (promotion)or
x (operation) or
2 (multiplier) |
|
Optional |
|
|
|
|
|
|
|
|
|
|
|
sortField |
|
promotion or
operation
multiplier
|
|
Optional |
|
|
|
sortOrder |
|
DESC or
ASC
|
|
Optional |
|
|
|
|
|
|
|
|
|
|
|
offset |
|
0 |
|
Optional |
|
|
|
length |
|
10 |
|
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 '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.
- The searchField and sortField are:
- promotion - For the text description of the promotion
- operation - Whether the promotion is a "+" (add) or "x" (multiply) promotion.
- multiplier - The amount the promotion adds to or multiplies the transaction amount by.
Example PHP Request:
If you are using PHP, the $data array would look like this:
- $data['API'] = '1.5';
- $data['user_id'] = 'john1970';
- $data['user_api_key'] = '1959caadac9b13dcb3';
- $data['account_id'] = 'greatwidgets';
- $data['type'] = 'campaign_promos';
- $data['campaign_id'] = '1111222233334444';
- $data['searchField'] = 'promotion';
- $data['searchValue'] = 'Bonus';
- $data['searchOper'] = 'cn';
- $data['sortField'] = 'promotion';
- $data['sortOrder'] = 'ASC';
- $data['offset'] = '30';
- $data['length'] = '10';
Success XML Response:
- <response status="success">
- <campaign>
- <id>1111222233334444</id>
- <name>Campaign Name</name>
- </campaign>
- <pagination>
- <total>56</total>
- <offset>30</offset>
- </pagination>
- <promotions>
- <promotion>
- <id>365</id>
- <operand>+</operand>
- <value>1000</value>
- <description>Sign-up Bonus</description>
- <promo_custom_id>XFA-567</promo_custom_id>
- <promo_start_date>2013-08-01 00:00:00</promo_start_date>
- <promo_end_date>2013-08-31 23:59:59</promo_end_date>
- </promotion>
- <promotion>
- <id>423</id>
- <operand>x</operand>
- <value>1.2</value>
- <description>20% More Points Tuesdays Bonus</description>
- <promo_custom_id>XFA-256</promo_custom_id>
- <promo_start_date>2013-09-01 08:00:00</promo_start_date>
- <promo_end_date>2013-09-31 23:59:59</promo_end_date>
- </promotion>
- ...
- </promotions>
- </response>
Notes:
Operands are either:
- "+" to add or subtract (negative value) an amount from the transaction.
- "x" to multiply the amount of the transaction by the value
No Promos XML Response:
- <response status="none">
- <message>Language-specific message</message>
- </response>
Error XML Response:
- <response status="error">
- <error>Error message</error>
- </response>
|
|