SMS Templates - Create New
Allows you to add a new sms template to an existing loyalty account. SMS templates allow you to send customers a different sms based on the following activity types: 1. Positive transactions, 2. Redemptions, 3. New account creation (enrollment/registration).
The data to be submitted to the API is composed of the following fields:
Fields common to all campaign types:
|
|
field |
|
Example |
|
Note |
|
|
|
API |
|
1.5 |
|
Required |
|
|
|
user_id |
|
john1970 |
|
Required |
|
|
|
user_api_key |
|
1959caadac9b13dcb3 |
|
Required |
|
|
|
type |
|
manage_sms_templates |
|
Required |
|
|
|
action |
|
new |
|
Required |
|
|
|
account_id |
|
greatwidgets |
|
Required |
|
|
|
template_name |
|
Welcome SMS |
|
Required |
|
|
|
sms_description |
|
This is the sms that new customers will receive when enrolling in the loyalty program |
|
Optional |
|
|
|
template_rule |
|
record, redeem, or new_customer |
|
Required |
|
|
|
campaign_id |
|
all or campaign id(s) |
|
Required |
|
|
|
template_subject |
|
Welcome to Amazing Rewards |
|
Required |
|
|
|
template_content |
|
[HTML Content] |
|
Required |
|
|
|
include_balance |
|
Y |
|
Optional |
|
|
|
include_rewards |
|
Y |
|
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:
- SMS Rule: Use "record" for positive transactions, "redeem" for deductions, and "new_accounts" for new customer accounts (enrollment/registration).
- Template Content: [HTML Content] Must keep format with escape variables in special characters.
- Only one tempalte can be created at a time. Loop this call in your program to create multiple templates at once.
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'] = 'manage_sms_templates';
- $data['action'] = 'new';
- $data['template_name'] = 'Welcome SMS'
- $data['template_description'] = 'Welcome SMS';
- $data['template_rule'] = 'new_accounts';
- $data['campaign_id'] = '1111222233334444';
- $data['template_subject'] = 'Welcome to Amazing Rewards';
- $data['template_content'] = 'Test SMS Content';
Success XML Response:
- <response status="success">
- <sms_template>
- <id>7</id>
- </sms_template>
- </response>
Error XML Response:
- <response status="error">
- <error>Error message</error>
- </response>
|