Push
Core schemas for push notifications, including push objects, notification payloads, Message Center messages, in-app messages, and related response objects.
Actions
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
OBJECT PROPERTIES- add_custom_event object
Emit a custom event when a user interacts with the push notification.
OBJECT PROPERTIES- name stringREQUIRED
The name of the custom event.
- properties object
A JSON object with the properties associated with the event.
- value number
An integer or decimal value of the event.
- add_tag array[string]
An array of tags.
- app_defined object
A map of registered action names to payloads as defined by the app or SDK. Some of these actions are supported as their own property on the Actions object, but be aware that their registered names in the SDK may be different. For a summary of the actions registered by the SDK, including usage information, see the Mobile docs.
- open object
Open action. When a user interacts with the notification, opens one of: URL, deep link, or landing page as described in the associated
One ofcontentproperty.- Open URL Action object
Opens a URL or passes a string for use as a custom action.
OBJECT PROPERTIES- content stringREQUIRED
Any string. A URL string that starts with either
httporhttpswill open a URL or a string that starts withtel:followed by a sequence of numbers will open the phone app. - type stringREQUIRED
Possible values:
url
- Open Deep Link Action object
Opens a deep link.
OBJECT PROPERTIES- content stringREQUIRED
A non-blank string.
- fallback_url string
A URL that can be used on platforms that don’t have full support for the otherwise defined action.
- type stringREQUIRED
Possible values:
deep_link
- Open Landing Page object
Opens a landing page.
OBJECT PROPERTIES- type stringREQUIRED
Possible values:
landing_page
- remove_tag array[string]
An array of tags.
String indicating the text that will populate the share action.
- subscription_list array[object]
Alter subscription list membership for a channel or contact.
Used in:
- Create and Send a message
- Create experiment (A/B Test)
- Create pipeline (automated message)
- Create template
- Experiment listing
- Experiment lookup
- List templates
- Look up a template
- Schedule a Create and Send message
- Schedule a notification
- Schedule a templated push
- Schedule message with bulk ID
- Scheduled experiment listing
- Send a push
- Send message with bulk ID
- Update pipeline
- Update schedule
- Update template
- Validate a push
- Validate Create and Send payload
- Validate experiment
- Validate message with bulk ID
- Validate pipeline
Examples
Example add custom event action
{
"actions": {
"add_custom_event": {
"name": "myCustomEvent",
"value": 12.5,
"properties": {
"property_key1": "value_property1",
"property_key2": 6789
}
}
}
}
Example tag actions
{
"actions": {
"add_tag": [
"airship",
"blimp"
],
"remove_tag": [
"boat",
"car"
],
"share": "Check out Airship!",
"open": {
"type": "url",
"content": "http://www.urbanairship.com"
},
"app_defined": {
"some_app_defined_action": "some_value"
}
}
}
Example landing page action
{
"actions": {
"open": {
"type": "landing_page",
"content": {
"body": "<html>content</html>",
"content_type": "text/html",
"content_encoding": "utf-8"
},
"fallback_url" : "https://www.urbanairship.com/settings"
}
}
}
Example open phone app
{
"actions": {
"open": {
"type": "url",
"content": "tel:15035551234"
}
}
}
Example deep link action
{
"actions": {
"open": {
"type": "deep_link",
"content": "prefs",
"fallback_url": "https://www.urbanairship.com/settings"
}
}
}
Example Subscription List action
{
"actions": {
"subscription_list": [
{
"action": "subscribe",
"type": "contact",
"list_id": "cool_deals",
"scope": "app"
}
]
}
}
Campaigns object
An object specifying custom campaign categories related to the notification.
OBJECT PROPERTIES- categories array[string]REQUIRED
Array of strings representing the campaigns you wish to associate with the notification. Must have between 1 to 10 items in the array with a 64 character/byte maximum per item.
Used in:
- Create and Send a message
- Create experiment (A/B Test)
- Create pipeline (automated message)
- Create template
- Experiment listing
- Experiment lookup
- List templates
- Look up a template
- Push to template
- Schedule a Create and Send message
- Schedule a notification
- Schedule a templated push
- Schedule message with bulk ID
- Scheduled experiment listing
- Send a push
- Send message with bulk ID
- Update pipeline
- Update schedule
- Update template
- Validate a push
- Validate a template
- Validate Create and Send payload
- Validate experiment
- Validate message with bulk ID
- Validate pipeline
Examples
Example campaigns in a push payload
{
"audience": "all",
"notification": {
"alert": "Taco Kitten wins Kentucky Derby by a whisker"
},
"campaigns": {
"categories": [
"kittens",
"tacos",
"horse_racing"
]
},
"device_types": [ "ios", "android" ]
}
In-app message
A JSON object describing an in-app message payload.
OBJECT PROPERTIES- actions object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- alert stringREQUIRED
The text displayed on the in-app message.
- display object
The allowed fields for this object depend on the value of of the
OBJECT PROPERTIESdisplay_typefield. Currently, the only validdisplay_typeisbanner, so the following is an associated display object for the banner display type.- duration integer
Specifies how long the notification should stay on the screen in seconds before automatically disappearing; set to
15by default. - position string
One of either
toporbottom, specifies the screen position of the message. Defaults tobottom.Possible values:
top,bottom - primary_color string
Specifies the primary color of the in-app message (format
#rrggbb). - secondary_color string
Specifies the secondary color of the in-app message (format
#rrggbb).
- display_type stringREQUIRED
Specifies the display type.
Possible values:
banner - expiry object
Delivery expiration, as either absolute ISO UTC timestamp, or number of seconds from now.
One of- string
A date-time.
- extra object
A JSON dictionary of string-to-string key-value pairs. If you wish to pass structured data in an extra key, it must be JSON-encoded as a string.
- interactive object<Interactive notification object>
An interactive notification.
Attempting to specify an interactive payload for an unsupported device type will result in an HTTP 400 response.
Used in:
- Create experiment (A/B Test)
- Create pipeline (automated message)
- Create template
- Experiment listing
- Experiment lookup
- List templates
- Look up a template
- Schedule a notification
- Schedule a templated push
- Schedule message with bulk ID
- Scheduled experiment listing
- Send a push
- Send message with bulk ID
- Update pipeline
- Update schedule
- Update template
- Validate a push
- Validate experiment
- Validate message with bulk ID
- Validate pipeline
Examples
Example
{
"audience": "all",
"device_types": [ "ios", "android" ],
"notification": { "alert": "This part appears on the lockscreen" },
"in_app": {
"alert": "This part appears in-app!",
"display_type": "banner",
"expiry": "2020-04-01T12:00:00",
"display": {
"position": "top"
},
"actions": {
"add_tag": "in-app"
}
}
}
Interactive notification object
An interactive notification.
Attempting to specify an interactive payload for an unsupported device type will result in an HTTP 400 response.
OBJECT PROPERTIESAn object containing keys that must be the button IDs for the specified interactive notification type. If the notification type begins with
One ofua_, the keys must match exactly the button IDs for that type or a strict subset. The names of the button IDs cannot be validated for custom notifications.- Yes/No object
Yes/No button action
OBJECT PROPERTIES- no object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- yes object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- Accept/Decline object
Accept/decline button action
OBJECT PROPERTIES- accept object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- decline object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- Shop Now object
Shop now button action
OBJECT PROPERTIES- shop_now object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- Buy Now object
Buy now button action
OBJECT PROPERTIES- buy_now object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- Follow object
Follow button action
OBJECT PROPERTIES- follow object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- Opt In object
Opt in button action
OBJECT PROPERTIES- opt_in object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- Unfollow object
Unfollow button action
OBJECT PROPERTIES- unfollow object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- Opt Out object
Opt out button action
OBJECT PROPERTIES- opt_out object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- Opt In/Remind object
Opt in/remind button action
OBJECT PROPERTIES- opt_in object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- remind object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- Remind object
Remind button action
OBJECT PROPERTIES- remind object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- More Info object
More info button action
OBJECT PROPERTIES- more_info object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- Download object
Download button action
OBJECT PROPERTIES- download object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- Share object
Share button action
OBJECT PROPERTIESDescribes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- Download/Share object
Download/share button action
OBJECT PROPERTIESDescribes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- Remind/Share object
Remind/share button action
OBJECT PROPERTIESDescribes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- Opt In/Share object
Opt in/share button action
OBJECT PROPERTIESDescribes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- Opt Out/Share object
Opt out/share button action
OBJECT PROPERTIESDescribes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- Follow/Share object
Follow/share button action
OBJECT PROPERTIESDescribes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- Unfollow/Share object
Unfollow/share button action
OBJECT PROPERTIESDescribes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- Shop Now/Share object
Shop now/share button action
OBJECT PROPERTIESDescribes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- Buy Now/Share object
Buy now/share button action
OBJECT PROPERTIESDescribes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- More Like/Less Like object
More like/less like button action
OBJECT PROPERTIES- less_like object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- more_like object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- Like/Dislike object
Like/dislike button action
OBJECT PROPERTIES- dislike object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- like object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- Like object
Like button action
OBJECT PROPERTIES- like object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- Like/Share object
Like/share button action
OBJECT PROPERTIESDescribes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- Add to Calendar/Remind object
Add to calendar/remind button action
OBJECT PROPERTIES- add_calendar object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- remind object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- Add object
Add button action
OBJECT PROPERTIES- add object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- Save object
Save button action
OBJECT PROPERTIES- save object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- Follow/Save object
Follow/Save button action
OBJECT PROPERTIES- follow object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- save object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- Rate object
Rate button action
OBJECT PROPERTIES- rate object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- Rate/Remind object
Rate/remind button action
OBJECT PROPERTIES- rate object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- remind object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- Search object
Search button action
OBJECT PROPERTIES- search object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- Book object
Book button action
OBJECT PROPERTIES- book object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- Happy/Sad object
Happy/Sad button action
OBJECT PROPERTIES- happy object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- sad object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- Up/Down object
Up/down button action
OBJECT PROPERTIES- down object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- up object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- type stringREQUIRED
A string that specifies the name of either a predefined or a custom-defined interactive notification type. Predefined types are prefixed with
ua_.Possible values:
ua_yes_no_foreground,ua_yes_no_background,ua_accept_decline_foreground,ua_accept_decline_background,ua_shop_now,ua_buy_now,ua_follow,ua_opt_in,ua_unfollow,ua_opt_out,ua_opt_in_remind,ua_remind_me_later,ua_more_info,ua_download,ua_share,ua_download_share,ua_remind_share,ua_opt_in_share,ua_opt_out_share,ua_follow_share,ua_unfollow_share,ua_shop_now_share,ua_buy_now_share,ua_more_like_less_like,ua_like_dislike,ua_like,ua_like_share,ua_add_calendar_remind,ua_add,ua_save,ua_follow_save,ua_rate,ua_rate_remind,ua_search,ua_book,ua_icons_happy_sad,ua_icons_up_down,<custom_defined_interactive_notification_type>
Used in:
- Create and Send a message
- Create experiment (A/B Test)
- Create pipeline (automated message)
- Create template
- Experiment listing
- Experiment lookup
- List templates
- Look up a template
- Schedule a Create and Send message
- Schedule a notification
- Schedule a templated push
- Schedule message with bulk ID
- Scheduled experiment listing
- Send a push
- Send message with bulk ID
- Update pipeline
- Update schedule
- Update template
- Validate a push
- Validate Create and Send payload
- Validate experiment
- Validate message with bulk ID
- Validate pipeline
Examples
Example with `type` actions
{
"interactive": {
"type": "ua_yes_no_foreground",
"button_actions": {
"yes": {
"add_tag": "more_cake_please",
"remove_tag": "lollipop",
"open": {
"type": "url",
"content": "http://www.urbanairship.com"
}
},
"no": {
"add_tag": "nope"
}
}
}
}
Example with `ua_share` actions
{
"interactive": {
"type": "ua_share",
"button_actions": {
"share": { "share": "Look at me! I'm on a boat." }
}
}
}
Landing page content
One of- OBJECT PROPERTIES
- url stringREQUIRED
The URL to be opened as a landing page. This value supports
httporhttpsschemes and can be personalized using handlebars expressions.
- All of
- OBJECT PROPERTIES
- content_encoding string
A string specifying the encoding of the text in the
bodyattribute. Defaults toutf-8.Possible values:
utf-8,base64 - content_type stringREQUIRED
A non-blank string, which must be a MIME type.
- OBJECT PROPERTIES
Localization object
An object used to indicate that message content delivered to a device should be customized for a specific locale subset. Each localization object must have at least one of country and language. Which of those two fields are present does not need to be consistent across localizations.
In addition, each localization object must have one of notification, message, or in_app set. If the top level notification, message, or in_app fields are set,
they will be delivered to any user in the audience not matching any of the localizations.
- country string
The ISO 3166-2 two-letter country code for this localization.
- in_app object<In-app message>
A JSON object describing an in-app message payload.
- language string
The ISO 639-1 two-letter language code for this localization.
- message object<Message Center object>
A Message Center message.
- notification object<Notification object>
The notification payload that is required unless either
messageorin_appis present. You can provide analertand any platform overrides that apply to thedevice_typeplatforms you specify.
Used in:
- Schedule a notification
- Schedule a templated push
- Schedule message with bulk ID
- Send a push
- Send message with bulk ID
- Update schedule
- Validate a push
- Validate message with bulk ID
Examples
Example array of localizations
{
"localizations": [
{
"language": "de",
"country": "AT",
"notification": {
"alert": "Grüss Gott"
}
},
{
"language": "de",
"country": "DE",
"notification": {
"alert": "Guten Tag"
}
}
]
}
Message Center object
A Message Center message.
OBJECT PROPERTIES- body stringREQUIRED
The body of the message.
- content_encoding string
A string denoting encoding type of the data in body. Defaults to
utf-8.base64encoding can be used in cases which would be complex to escape properly, just as HTML containing embedded javascript code, which itself may contain embedded JSON data. - content_type string
A string denoting the MIME type of the data in body. Defaults to
text/html. - expiry object
Delivery expiration, as either absolute ISO UTC timestamp, or number of seconds from now.
One of- string
A date-time.
- extra object
A JSON dictionary of string-to-string key-value pairs. If you wish to pass structured data in an extra key, it must be JSON-encoded as a string.
- icons object
A JSON dictionary of string key and value pairs representing icons. At this time, only the
OBJECT PROPERTIESlist_iconkey is supported. Values must be URI/URLs to icon resources. For resources hosted by UA, use the following URI formatua:<resource_id>.- list_icon string
- title stringREQUIRED
The title of the message.
Used in:
- Create pipeline (automated message)
- Schedule a notification
- Schedule a templated push
- Schedule message with bulk ID
- Send a push
- Send message with bulk ID
- Update pipeline
- Update schedule
- Validate a push
- Validate message with bulk ID
- Validate pipeline
Examples
Message object example
{
"audience": "all",
"notification": {
"ios": {
"badge": "+1"
}
},
"message": {
"title": "This week's offer",
"body": "<html><body><h1>blah blah</h1> etc...</html>",
"content_type": "text/html",
"expiry": "2020-04-01T12:00:00",
"extra": {
"offer_id": "608f1f6c-8860-c617-a803-b187b491568e"
},
"icons": {
"list_icon": "http://cdn.example.com/message.png"
}
}
}
Message Center with template
Use a template with a message center message. You can reference a template by ID, or use {{handlebars}} directly in your message.
- content_encoding string
A string denoting encoding type of the data in body. Defaults to
utf-8.base64encoding can be used in cases which would be complex to escape properly, just as HTML containing embedded javascript code, which itself may contain embedded JSON data. - content_type string
A string denoting the MIME type of the data in body. Defaults to
text/html. - expiry object
Delivery expiration, as either absolute ISO UTC timestamp, or number of seconds from now.
One of- string
A date-time.
- extra object
A JSON dictionary of string-to-string key-value pairs. If you wish to pass structured data in an extra key, it must be JSON-encoded as a string.
- icons object
A JSON dictionary of string key and value pairs representing icons. At this time, only the
OBJECT PROPERTIESlist_iconkey is supported. Values must be URI/URLs to icon resources. For resources hosted by UA, use the following URI formatua:<resource_id>.- list_icon string
- template objectOne of
- OBJECT PROPERTIES
- template_id string
The
IDof a template that you created in the Airship dashboard. To get your template IDs, go to Content and select Templates.
- OBJECT PROPERTIES
- fields object
Items in the field object are personalizable with handlebars.
OBJECT PROPERTIES- html_body string
The body of the message. This can be a full HTML message.
- title string
The title of the message.
- OBJECT PROPERTIES
Used in:
- Create pipeline (automated message)
- Schedule a notification
- Schedule a templated push
- Schedule message with bulk ID
- Send a push
- Send message with bulk ID
- Update pipeline
- Update schedule
- Validate a push
- Validate message with bulk ID
- Validate pipeline
Examples
Message Center with template using handlebars example
{
"message": {
"title": "Save on {{product}} through {{end_date}}!",
"body": "<html><body><h1>here's a cool {{offer}}</h1> etc...</html>",
"content_type": "text/html",
"expiry": "2020-04-01T12:00:00",
"extra": {
"offer_id": "608f1f6c-8860-c617-a803-b187b491568e"
},
"icons": {
"list_icon": "http://cdn.example.com/message.png"
}
}
}
Message Center with template by ID example
{
"message": {
"template": {
"template_id": "my_template_id"
}
}
}
Message type
Indicates the purpose of a message.
Used in:
- Schedule a notification
- Schedule a templated push
- Schedule message with bulk ID
- Send a push
- Send message with bulk ID
- Update schedule
- Validate a push
- Validate message with bulk ID
Notification object
The notification payload that is required unless either message or in_app is present. You can provide an alert and any platform overrides that apply to the device_type platforms you specify.
- actions object<Actions>
Describes Actions to be performed by the SDK when a user interacts with the notification. You can personalize message actions using Handlebars.
- alert string
A notification message, displayed for any platforms receiving the push without a platform override.
- amazon objectOne of
The platform override section for Kindle Fire (for Amazon Device Messaging).
Use a
templatewith a Fire OS-specific message. You can reference a template by ID, or use{{handlebars}}directly in your message.
- android objectOne of
The platform override section for Android. Maximum 4,096 bytes.
Use a
templatewith an Android-specific fields. You can reference a template by ID, or use{{handlebars}}directly in your message.
- email objectOne of
Notification fields specific to email messages. This object is required when
emailis specified in the payload’sdevice_typesfield.Notification fields specific to email messages with an inline template for use in a Create and Send payload. Using a template enables you to provide and populate variables in your notification. You can also add conditional statements based on those variables, determining message text that to send to each member of your audience. Conditionals begin with
{{#operator}}and end with{{/operator}}. For more information, see Handlebars.
- interactive object<Interactive notification object>
An interactive notification.
Attempting to specify an interactive payload for an unsupported device type will result in an HTTP 400 response.
- ios objectOne of
The platform override section for iOS. Maximum 4,096 bytes.
Use a
templatewith iOS-specific message. You can reference a template by ID, or use{{handlebars}}directly in your message.
- mms objectOne of
Provides the content for a push to MMS channels. If
smsis in thedevice_typearray, your request may include this object. It cannot be combined with an SMS Platform Override as a single push can only include either an SMS or MMS payload.Template and notification overrides for a Create and Send payload with
device_typesset tomms. With a template, you can provide and populate variables and conditional statements based on those variables. Conditionals begin with{{#operator}}and end with{{/operator}}. For more information, see Handlebars.
- open::open_platform_name objectOne of
The platform override section for open platforms uses the prefix attribute
open::before the configured open platform name. Theopen::<open_platform_name>object will contain an object with the following attributes.Use a
templatewith an open channel-specific message. You can reference a template by ID, or use{{handlebars}}directly in your message.
- sms objectOne of
Provides override options when
smsis one of thedevice_typesspecified in the payload.Notification fields specific to SMS messages with an inline template for use in a Create and Send payload. Using a template enables you to provide and populate variables in your notification. You can also add conditional statements based on those variables, determining message text that to send to each member of your audience. Conditionals begin with
{{#operator}}and end with{{/operator}}. For more information, see Handlebars.
- web objectOne of
The
webplatform overrides determine message behaviors for web notifications.Safari behaves differently from other browsers and supports only the
alertandtitleoverrides. It ignores all otherweboverrides.Use a
templatewith a Web-specific message. You can reference a template by ID, or use{{handlebars}}directly in your message.Safari behaves differently from other browsers and supports only the
alertandtitleoverrides. It ignores all otherweboverrides.
Used in:
- Create experiment (A/B Test)
- Create pipeline (automated message)
- Create template
- Experiment listing
- Experiment lookup
- List templates
- Look up a template
- Schedule a notification
- Schedule a templated push
- Schedule message with bulk ID
- Scheduled experiment listing
- Send a push
- Send message with bulk ID
- Update pipeline
- Update schedule
- Update template
- Validate a push
- Validate experiment
- Validate message with bulk ID
- Validate pipeline
Examples
Example notification with all platforms
{
"audience": "all",
"device_types": [
"ios",
"android",
"amazon",
"web",
"email",
"open::toaster"
],
"notification": {
"ios": {
"alert": "Hello, iDevices"
},
"android": {
"alert": "These are not the...yeah, lame joke."
},
"amazon": {
"alert": "Read any good books lately?"
},
"web": {
"alert": "Oh the tangled web we weave"
},
"email": {
"subject": "Did you get that thing I sent you?",
"html_body": "<h2>Richtext body goes here</h2><p>Wow!</p><p><a data-ua-unsubscribe=\"1\" title=\"unsubscribe\" href=\"http://unsubscribe.urbanairship.com/email/success.html\">Unsubscribe</a></p>",
"plaintext_body": "Plaintext version goes here [[ua-unsubscribe href=\"http://unsubscribe.urbanairship.com/email/success.html\"]]",
"message_type": "commercial",
"sender_name": "Airship",
"sender_address": "team@urbanairship.com",
"reply_to": "no-reply@urbanairship.com"
},
"open::toaster": {
"alert": "Would you like avocados with that?"
}
}
}
Push object
A push object describes everything about a push notification, including the audience and push payload. A push object is composed of up to seven attributes.
OBJECT PROPERTIESAn audience selector forms the expression that determines the set of channels to target.
- campaigns object<Campaigns object>
An object specifying custom campaign categories related to the notification.
- device_types array[string]REQUIRED
An array containing one or more strings identifying targeted platforms.
- feed_references object<Feed references object>
An object used to indicate that an external data feed should be invoked, the name of the feed to invoke, and the way in which to invoke it. You can only include a feed if you include a
templatesobject in the payload or set thepersonalizationoption totrue. - global_attributes object
The global attributes object may contain an arbitrary set of keys and values, including arrays and nested objects, which will be added to the global attributes rendering namespace for this push. Top-level keys must start with a letter and cannot start with the reserved sequence
ua_. If the global attributes object is nonempty, it implies thepersonalization: trueoption. - in_app object<In-app message>
A JSON object describing an in-app message payload.
- localizations array
An array of localizations. Channels bearing the specified language/country combination will receive the corresponding message.
- message objectOne of
A Message Center message.
Use a
templatewith a message center message. You can reference a template by ID, or use{{handlebars}}directly in your message.
- message_type object<Message type>
Indicates the purpose of a message.
- notification object<Notification object>
The notification payload that is required unless either
messageorin_appis present. You can provide analertand any platform overrides that apply to thedevice_typeplatforms you specify. - options object<Push options>
A JSON dictionary for specifying non-payload options related to the delivery of the push.
- orchestration object
An object used to indicate the strategy to employ when deciding which channels to target for a contact. An orchestration object can be stored in Airship as the default strategy. If the orchestration section is included in a push payload, it will override the configured default value. The overall default strategy is
OBJECT PROPERTIESfan_out.- channel_priority array[string]
An array of channel types in priority order. Required if
typeis set tochannel_priority. - type stringREQUIRED
The name of the orchestration strategy to employ.
Possible values:
channel_priority,fan_out,triggering_channel,last_active
- snippet_references object<Snippet references object>
An object used to indicate that a set of snippets should be loaded for use in message content. Use the following syntax in your payload:
{{> your_snippet_name }}to reference the snippet content within a notification or rich message.See Snippets to see how to create a snippet in the Airship dashboard.
Used in:
Examples
Example push object
{
"audience": {
"OR": [
{
"tag": [
"sports",
"entertainment"
]
},
{
"ios_channel": "9c36e8c7-5a73-47c0-9716-99fd3d4197d5"
}
]
},
"notification": {
"alert": "Hi from Airship!{{#if super_sale }} We're having a sale on {{ products.0.name }}!{{/if}}",
"ios": {
"extra": {
"url": "http://www.urbanairship.com"
}
}
},
"options": {
"expiry": "2020-04-01T12:00:00"
},
"message": {
"title": "Message title",
"body": "<Your message here>",
"content_type": "text/html"
},
"in_app": {
"alert": "This part appears in-app!",
"display_type": "banner",
"expiry": "2020-04-01T12:00:00",
"display": {
"position": "top"
}
},
"device_types": [ "ios", "android" ],
"global_attributes": {
"super_sale": true,
"products": [
{"id": 1, "name": "New Line Sneakers", "price": "79.95"},
{"id": 2, "name": "Old Line Sneakers", "price": "59.95"}
]
}
}
Example personalized push
{
"device_types": [
"sms"
],
"options": {
"personalization": true
},
"notification": {
"sms": {
"alert": "Hi {{name}}, {{#feed \"weather_updates\" kw="today" as |weather|}}It's going to be {{weather.temp}} in {{weather.loc}} today!{{/feed}}",
}
},
"audience": {
"tag": "local_updates",
"group": "weather"
},
"feeds": [
{
"name": "weather_updates",
"params": {
"kw": "today"
}
}
]
}
Example localized push
{
"device_types": [ "ios", "android" ],
"audience": {
"tag": "needs_a_greeting",
"group": "new_customer"
},
"notification": {
"alert": "Hi!"
},
"localizations": [
{
"language": "de",
"country": "AT",
"notification": {
"alert": "Grüss Gott"
}
},
{
"language": "de",
"country": "DE",
"notification": {
"alert": "Guten Tag"
}
}
]
}
Push options
A JSON dictionary for specifying non-payload options related to the delivery of the push.
OBJECT PROPERTIES- audience_limits object<Audience limits object>
Defines limits to be applied to Push Notifications and standard in-app messages (not In-App Automations or Scenes) only. See Audience Limit in the Message delivery user guide for additional information and limitations.
- ban_list_parameters object<Ban List parameters>
A list of parameters, where the key and value are both strings, that will be used to override the default values set for variables in a Ban List request URL.
- bypass_ban_list_processing boolean
If true, a user’s status on a Ban List will not be verified before sending the push.
- bypass_frequency_limits boolean
If true, the push ignores any Message Limits that would otherwise apply to your message.
- bypass_holdout_groups boolean
If true, the push ignores withholding any messages for users in a holdout group for a Holdout Experiment that is active at send time.
- expiry object
Delivery expiration, as either absolute ISO UTC timestamp, or number of seconds from now.
One of- string
A date-time.
- no_throttle boolean
If true, the push will ignore global throttling rates that have been configured for the application, resulting in delivery as quickly as possible.
- omit_from_activity_log boolean
If true, the push is omitted from the Activity Log.
- personalization boolean
If true, enables Handlebars-style template syntax for eligible fields in a notification or message center objects. You can do this to enable handlebars for all available fields without using individual
templateobjects for different platform overrides.This setting is implicitly true whenever your payload includes a platform override with a
templateobject. - redact_payload boolean
If true, the push payload will not appear in Airship’s logs. You cannot use this option with Message Center, A/B Tests, Automation, or Scheduled pushes, which all require the payload to be stored separately by design.
- use_strict_sms_validation boolean
This field is only compatible for Create and Send requests targeting
SMSandMMSdevice_types.If true, Create and Send requests containing any selector entries that would result in silent row drops will return a
400 Bad Requestresponse code. Detailed error messages will be returned for all invalid rows.If false, requests that contain row entries with silent errors as documented for the targeted required selector fields will return a
200status code. However, all invalid entries will be silently dropped during request processing.By default, this attribute is implicitly set to
falseunless every entry in the request would be dropped silently as determined by the targeted selector type, at least one malformed JSON error is found in the request, or at least one validation error is encountered for a required selector field that is not documented to handle invalid data with silent drops.
Used in:
- Create experiment (A/B Test)
- Create pipeline (automated message)
- Experiment listing
- Experiment lookup
- Schedule a notification
- Schedule a templated push
- Schedule message with bulk ID
- Scheduled experiment listing
- Send a push
- Send message with bulk ID
- Update pipeline
- Update schedule
- Validate a push
- Validate experiment
- Validate message with bulk ID
- Validate pipeline
Snippet references object
An object used to indicate that a set of snippets should be loaded for use in message content. Use the following syntax in your payload: {{> your_snippet_name }} to reference the snippet content within a notification or rich message.
See Snippets to see how to create a snippet in the Airship dashboard.
OBJECT PROPERTIES- snippets array[object]REQUIRED
An array of snippets that you want to use to personalize your message.
Used in:
- Schedule a notification
- Schedule a templated push
- Schedule message with bulk ID
- Send a push
- Send message with bulk ID
- Update schedule
- Validate a push
- Validate message with bulk ID
Examples
Example push snippets request
POST /api/push HTTP/1.1
Authorization: Basic <Master authorization string>
Accept: application/vnd.urbanairship+json; version=3
Content-Type: application/json
{
"device_types": ["ios"],
"audience": { "tag": "earlyBirds" },
"notification": {
"alert": "Hello, {{user}}, how are you today?{{> \"signoff\" }}"
},
"options": {
"personalization": true
},
"snippet_references": {
"snippets": [
{
"name": "signoff"
}
]
}
}
HTTP/1.1 202 Accepted
Content-Type: application/vnd.urbanairship+json; version=3
Content-Length: 123
Data-Attribute: push_ids
{
"ok": true,
"operation_id": "5e7852b0-6909-4e60-a73f-4d6b92d94c80",
"push_ids": [
"bf28d158-fefe-475a-9c2a-ed4f69cc891e"
]
}
Snippet references example: The `copyright` snippet is loaded by the `snippet_references` object and inserted at the end of the `alert` text.
{
"notification": {
"alert": "Hi {{ name }}: Thanks for your purchase! {{> copyright }}"
},
"snippet_references": {
"snippets": [
{
"name": "copyright"
}
]
}
}