Content objects

Schemas for Content templates and per-channel content payloads.

App and web content template object

The app and web push fields for a template.

Jump to examples ↓

OBJECT PROPERTIES
  • alert stringREQUIRED

    The text that will display in your push notification.

  • icon string

    A string representing a URL or an image file included in the application’s resources.

  • summary string

    Supplemental text displayed with the notification.

  • title string

    A heading that appears above the notification text when applicable.

Used in:

Examples

Example app and web template object

{
    "title": "Shoe sale on {{level}} floor!",
    "alert": "All the shoes are on sale {{name}}!",
    "summary": "Don't miss out!",
    "icon": "shoes"
}

Content template object

A reusable template containing fields for a message type. Can be referenced by its UUID or a customer-defined external ID.

Jump to examples ↓

OBJECT PROPERTIES
  • content objectREQUIRED

    The content of the given type, using the associated model object below.

    One of
  • created_at string

    The date-time when this template was created.

    Format: date-time

    Read only: true

  • description string

    The description of the template.

  • external_id string

    An optional ID for referencing this template in future API calls. Must be unique within your project.

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

  • id string

    The unique ID assigned to the template. Used to retrieve or reference the template in other endpoints.

    Format: uuid

    Read only: true

  • modified_at string

    The date-time when this template was last modified.

    Format: date-time

    Read only: true

  • name stringREQUIRED

    The human-readable name of the template.

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

  • type stringREQUIRED

    The type of message.

    Possible values:

    • email
    • sms
    • open
    • app
    • web
    • message_center

Used in:

Examples

Example content template object

{
    "id": "ef34a8d9-0ad7-491c-86b0-aea74da15161",
    "external_id": "customer-defined-id",
    "name": "Welcome Message",
    "description": "Our welcome message",
    "type": "email",
    "content": {
        "subject": "Welcome!",
        "html_body": "<html><body>Hi, {{first_name}}!</body></html> {{>copyright}}",
        "plaintext_body": "Hi, {{first_name}}!"
    },
    "created_at": "2020-08-17T11:10:02Z",
    "modified_at": "2020-08-17T11:10:02Z",
    "feed_references": {
        "feeds": [
          {
            "name": "featured_product"
          }
        ],
        "defaults": {
          "featured_product": {
            "category": "featured"
          }
        }
    },
    "snippet_references": {
        "snippets": [
          {
            "name": "copyright"
          }
        ]
    }
}

Email content template object

The email-specific fields for a template.

Jump to examples ↓

OBJECT PROPERTIES
  • html_body stringREQUIRED

    The HTML content of the email.

  • plaintext_body stringREQUIRED

    The plaintext content of the email.

  • subject stringREQUIRED

    The email subject.

Used in:

Examples

Example email template object

{
    "subject": "Welcome!",
    "html_body": "<html><body>Hi, {{first_name}}!</body></html>",
    "plaintext_body": "Hi, {{first_name}}!"
}

Message Center content template object

The Message Center-specific fields for a template.

Jump to examples ↓

OBJECT PROPERTIES
  • html_body stringREQUIRED

    The body of the message. This can be a full HTML message.

  • title string

    A heading that appears above the message and in the Message Center inbox.

Used in:

Examples

Example Message Center template object

{
    "html_body": "<h2>Richtext body goes here</h2><p><a data-ua-unsubscribe=\"1\" title=\"unsubscribe\" href=\"http://unsubscribe.urbanairship.com/email/success.html\">Unsubscribe</a></p>",
    "title": "Message Center Notification"
}

Open channel content template object

The open channel-specific fields for a template.

Jump to examples ↓

OBJECT PROPERTIES
  • alert stringREQUIRED

    The text that will display in your open channel message.

  • media_attachment string

    The URL for media you want to include in your message.

  • summary string

    Supplemental text displayed with the notification.

  • title string

    A heading that appears above the notification text when applicable.

Used in:

Examples

Example open channel template object

{
    "title": "SMS Alert!",
    "alert": "A shorter alert for SMS users",
    "summary": "A longer summary of text alongside the notification",
    "media_attachment": "https://example.com/cat_standing_up.jpeg"
}

SMS content template object

The SMS-specific fields for a template.

Jump to examples ↓

OBJECT PROPERTIES
  • alert stringREQUIRED

    The SMS content.

Used in:

Examples

Example SMS template object

{
    "alert": "My SMS message"
}