Notification Objects

A Notification Object is a common Object shared by both In App Notifications and Feed Notifications, though some attributes may be specific to one or the other types.

A Notification Object is made up of multiple different components. Each component contains the following basic attributes

  • type
  • position
  • attrs

Type indicates the specific component type that needs to be rendered. This can be one of the following values:

  • admin_header_with_message
  • image
  • headline
  • text
  • call_to_action

Position indicates the position or order in which the component should be rendered in the In App Notification. Each display position of components in an In App Notification can be rearranged at the time of creation, and therefore this needs to be considered during rendering.

Attrs is an array of attributes used to build each component, and is different for each component. These are defined as below.

Personal Message

The Personal Message component contains the following attributes which are used to render the component. Please note that while this component can return an array of attributes, only a single element should be rendered

  • admin.job_title: String
    The title of the person sending the Notification
  • admin.name: String
    The name of the person sending the Notification
  • admin.avatar_url: String
    A URL referencing the Avatar Image of the person sending the Notification
  • message: String
    The message the person sending the Notification wishes to display

Image

The Image component contains the following attributes which are used to render the component. Please note that while this component can return an array of attributes, only a single element should be rendered.

  • name: String
    This is a the name of the image and can be used for Alt text where required
  • image_url: String
    This is the URL of the image to display
  • width: Integer
    This is the width of the image to display
  • height: Integer
    This is the height of the image to display.

Headline

The Headline component contains the following attributes which are used to render the component. Please note that while this component can return an array of attributes, only a single element should be rendered

  • text: String
    The text to display

Text

The Text component contains the following attributes which are used to render the component. Please note that while this component can return an array of attributes, only a single element should be rendered

  • text: String
    The text to display

Call To Action

The Call to Action component contains the following attributes which are used to render the component. Please note that this component returns an array of attributes. Each element in the array should be rendered.

  • destination_type: Enum
    Can be either url, openfeed, deeplink or dismiss. Determines how the Call To Action is handled.
  • destination: String
    Is a String referencing the destination. Used in conjunction with destination_type
  • in_app_events: Array
    Is an Array of Strings of Events that should be sent
  • label: String
    Is the text value of the button
  • show_btn: Boolean (true | false)
    Is a Boolean indicating if the button should be visible or not
  • order_number: Integer
    Indicates the order the button should be displayed in. The order indicates of the button is primary, secondary or other.