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.

Jump to examples ↓

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 content property.

    One of
    • 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 http or https will open a URL or a string that starts with tel: 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
      • A non-blank string.

      • A URL that can be used on platforms that don’t have full support for the otherwise defined action.

      • Possible values: deep_link

    • Open Landing Page object

      Opens a landing page.

      OBJECT PROPERTIES
  • remove_tag array[string]

    An array of tags.

  • share string

    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:

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.

Jump to examples ↓

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:

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.

Jump to examples ↓

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 display_type field. Currently, the only valid display_type is banner, so the following is an associated display object for the banner display type.

    OBJECT PROPERTIES
    • duration integer

      Specifies how long the notification should stay on the screen in seconds before automatically disappearing; set to 15 by default.

    • position string

      One of either top or bottom, specifies the screen position of the message. Defaults to bottom.

      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
  • 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.

  • An interactive notification.

    Attempting to specify an interactive payload for an unsupported device type will result in an HTTP 400 response.

Used in:

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.

Jump to examples ↓

OBJECT PROPERTIES
  • button_actions object

    An object containing keys that must be the button IDs for the specified interactive notification type. If the notification type begins with ua_, 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.

    One of
    • 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 PROPERTIES
      • share 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/Share object

      Download/share 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<Actions>

        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 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.

      • share 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/Share object

      Opt in/share 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.

      • share 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/Share object

      Opt out/share 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.

      • share 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/Share object

      Follow/share 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.

      • share 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/Share object

      Unfollow/share button action

      OBJECT PROPERTIES
      • share 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<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/Share object

      Shop now/share button action

      OBJECT PROPERTIES
      • share 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<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/Share object

      Buy now/share 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.

      • share 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/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 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.

      • share 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 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
      • 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:

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 http or https schemes and can be personalized using handlebars expressions.

  • All of
    • OBJECT PROPERTIES
      • content_encoding string

        A string specifying the encoding of the text in the body attribute. Defaults to utf-8.

        Possible values: utf-8, base64

      • content_type stringREQUIRED

        A non-blank string, which must be a MIME type.

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.

Jump to examples ↓

OBJECT PROPERTIES
  • 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 message or in_app is present. You can provide an alert and any platform overrides that apply to the device_type platforms you specify.

Used in:

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.

Jump to examples ↓

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. base64 encoding 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
  • 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 list_icon key is supported. Values must be URI/URLs to icon resources. For resources hosted by UA, use the following URI format ua:<resource_id>.

    OBJECT PROPERTIES
    • list_icon string
  • title stringREQUIRED

    The title of the message.

Used in:

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.

Jump to examples ↓

OBJECT PROPERTIES
  • content_encoding string

    A string denoting encoding type of the data in body. Defaults to utf-8. base64 encoding 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
  • 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 list_icon key is supported. Values must be URI/URLs to icon resources. For resources hosted by UA, use the following URI format ua:<resource_id>.

    OBJECT PROPERTIES
    • list_icon string
  • template object
    One of
    • OBJECT PROPERTIES
    • 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.

Used in:

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:

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.

Jump to examples ↓

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 string

    A notification message, displayed for any platforms receiving the push without a platform override.

  • amazon object
    One of
    • The platform override section for Kindle Fire (for Amazon Device Messaging).

    • Use a template with a Fire OS-specific message. You can reference a template by ID, or use {{handlebars}} directly in your message.

  • android object
    One of
  • email object
    One of
    • Notification fields specific to email messages. This object is required when email is specified in the payload’s device_types field.

    • 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.

  • An interactive notification.

    Attempting to specify an interactive payload for an unsupported device type will result in an HTTP 400 response.

  • ios object
    One of
    • The platform override section for iOS. Maximum 4,096 bytes.

    • Use a template with iOS-specific message. You can reference a template by ID, or use {{handlebars}} directly in your message.

  • mms object
    One of
    • Provides the content for a push to MMS channels. If sms is in the device_type array, 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_types set to mms. 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 object
    One of
    • The platform override section for open platforms uses the prefix attribute open:: before the configured open platform name. The open::<open_platform_name> object will contain an object with the following attributes.

    • Use a template with an open channel-specific message. You can reference a template by ID, or use {{handlebars}} directly in your message.

  • sms object
    One of
    • Provides override options when sms is one of the device_types specified 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 object
    One of
    • The web platform overrides determine message behaviors for web notifications.

      Safari behaves differently from other browsers and supports only the alert and title overrides. It ignores all other web overrides.

    • Use a template with 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 alert and title overrides. It ignores all other web overrides.

Used in:

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.

Jump to examples ↓

OBJECT PROPERTIES
  • audience object<Audience selector (max 1000)>REQUIRED

    An 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 templates object in the payload or set the personalization option to true.

  • 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 the personalization: true option.

  • 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 object
    One of
  • message_type object<Message type>

    Indicates the purpose of a message.

  • notification object<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.

  • 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 fan_out.

    OBJECT PROPERTIES
    • channel_priority array[string]

      An array of channel types in priority order. Required if type is set to channel_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
  • 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 template objects for different platform overrides.

    This setting is implicitly true whenever your payload includes a platform override with a template object.

  • 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 SMS and MMS device_types.

    If true, Create and Send requests containing any selector entries that would result in silent row drops will return a 400 Bad Request response 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 200 status code. However, all invalid entries will be silently dropped during request processing.

    By default, this attribute is implicitly set to false unless 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:

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.

Jump to examples ↓

OBJECT PROPERTIES
  • snippets array[object]REQUIRED

    An array of snippets that you want to use to personalize your message.

Used in:

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"
         }
      ]
   }
}