Create trigger app

This API creates a trigger app associated with the specified trigger. The API supports the following request data objects: email, sms, forward, push_ios, push_android, and push_baidu. See the request examples below.

Note on forward: A forwarding trigger app posts json-formatted device, property, and custom data to the given REST API endpoint. The request data object sent to the specified endpoint resembles the following:

{
  "device": {
    "dsn": "AC000W000000001",
    "product_name": "Device 1"
  },
  "property": {
    "name": "my_prop",
    "base_type": "integer",
    "value": "25",
    "data_updated_at": "2019-09-20T19:02:04Z"
  },
  "data": "custom text"
}
NameTypeDescription
namestring (255 chars)email, sms, forward, push_ios, push_android, push_baidu
nicknamestring (255 chars)Name of Trigger App
usernamestring (255 chars)email greeting
repeat_freqinteger (default=30)repeat interval in seconds
param1string (255 chars)name-dependent
param2string (255 chars)name-dependent
param3string (255 chars)name-dependent
param4string (255 chars)name-dependent
param5string (255 chars)name-dependent
contact_idintegerAyla contact id of sender. See the getContact API.
push_soundstring (255 chars)mps sound file name
push_mdatastring (255 chars)metadata key/value pairs: "key1:value1, key2:value2"
email_template_idstring (255 chars)ID of custom email template
email_subjectstring (255 chars)Email subject line
email_body_htmlstring (255 chars)Email body with template tags
requires_acceptanceboolean (default=false)true=enables acceptance flow for SMS applications
{
   "trigger_app": {
        "name": "email",
        "username": "test",
        "repeat_freq": "60",
        "param1": "[email protected]",
        "param3": "test",
        "email_template_id": "test",
        "email_subject": "test",
        "email_body_html": "test"
    }
 }
{
  "trigger_app": {
    "name": "sms",
    "nickname": "Name of Trigger App",
    "repeat_freq": 0,
    "param1": "country code of phone number",
    "param2": "phone number",
    "param3": "text to send",
    "param4": "if acceptance=true, acceptance message, if false, unused",
    "contact_id": "sender contact id",
    "requires_acceptance": true=enables acceptance flow for SMS applications.
  }
}
{
  "trigger_app": {
    "name": "forward",
    "nickname": "Name of Trigger App",
    "repeat_freq": 0,
    "param1": "",
    "param2": "REST API endpoint for POST method",
    "param3": "username for POST basic auth",
    "param4": "password for POST basic auth",
    "param5": "custom data to send"
  }
}
{
  "trigger_app": {
    "name": "push_ios",
    "nickname": "Name of Trigger App",
    "repeat_freq": 0,
    "param1": "registration ID from Apple without dashes or spaces",
    "param2": "key assigned to PERM",
    "param3": "optional message (max 100 chars)",
    "push_sound": "mp3 file name (max 50 chars)",
    "push_mdata": "metadata key/value pairs (max 50 chars)"
  }
}
{
  "trigger_app": {
    "name": "push_android",
    "nickname": "Name of Trigger App",
    "repeat_freq": 0,
    "param1": "registration ID from Google",
    "param3": "optional message (max 100 chars)",
    "push_sound": "mp3 file name (max 50 chars)",
    "push_mdata": "metadata key/value pairs (max 50 chars)"
  }
}
{
  "trigger_app": {
    "name": "push_baidu",
    "nickname": "Name of Trigger App",
    "repeat_freq": 0,
    "param1": "registration ID from Baidu",
    "param2": "Channel ID",
  }
}
Language
Authorization
Header
Click Try It! to start a request and see the response here!