Webhooks

Take mobile events and pass them directly to your backend systems using webhooks. The Urban Airship Connect Webhooks integration takes user-level events in real time, and passes them to the webhook URL that you provide.

This integration is similar to a Direct Connection. The difference between the two is that:

  • With webhooks, you tell us where to send the events by providing a URL, headers, and authorization info.
  • With a direct connection, you control when you pull data from the raw data stream and filter the data according to the needs of the system that consumes it.

What is a Webhook?

A webhook is a custom HTTP callback, generally triggered by a an event or action initiated by a user, service, or application. When the event occurs, the originating application notifies the specified URL configured for the webhook.

Webhooks are popular with web developers because they can be configured to trigger all manner of events from system to system, enabling real-time workflows across the web and your internal systems.

Setup

Getting started with Urban Airship webhooks is easy and requires an Urban Airship agreement that includes Connect. Just follow these steps:

  1. Contact your Urban Airship Account Manager and request a webhook connection.
  2. Wait to hear from our Product team for basic details about your integration like app key, URL and header information.
  3. We will pass your app’s Connect events to the specified URL.

Example event:

POST https://example.com HTTP/1.1
Content-Length: 799
Content-Type: application/json; charset=UTF-8
Custom-Header1: Value1
Custom-Header2: Value2
Authorization: Basic dXNhcj0wYXNzd29yZA==

{
   "id":"7e7f5990-d277-4636-b22c-912cb2ca2ec9",
   "offset":"1245924",
   "occurred":"2016-12-08T21:27:01.125Z",
   "processed":"2016-12-08T21:27:03.000Z",
   "device":{
      "ios_channel":"1819298f-065f-46f1-81a0-1fea91f65ce7",
      "attributes":{
         "locale_variant":"",
         "app_version":"1.2.3",
         "device_model":"x86_64",
         "connection_type":"WIFI",
         "app_package_name":"com.company.app",
         "iana_timezone":"America/Los_Angeles",
         "push_opt_in":"false",
         "locale_country_code":"US",
         "device_os":"10.1",
         "locale_timezone":"-28800",
         "locale_language_code":"en",
         "location_enabled":"true",
         "background_push_enabled":"false",
         "ua_sdk_version":"8.0.1",
         "location_permission":"ALWAYS_ALLOWED"
      }
   },
   "body":{
      "name":"finished_game",
      "session_id":"e025bde1-f974-42fa-a925-aca7054218dc",
      "properties":{
         "game_name":"snaps",
         "game_score":1000
      }
   },
   "type":"CUSTOM"
}

Event Types

Any event type supported in Connect can be configured for a webhook. Below is a list of the current event types, including Custom Events, which provide the most flexibility.

"PUSH_BODY"
"OPEN"
"SEND"
"CONTROL"
"CLOSE"
"RICH_DELIVERY"
"RICH_READ"
"RICH_DELETE"
"CUSTOM"
"LOCATION"
"TAG_CHANGE"
"UNINSTALL"
"FIRST_OPEN"
"REGION"
"SCREEN_VIEWED"
"IN_APP_MESSAGE_DISPLAY"
"IN_APP_MESSAGE_RESOLUTION"
"IN_APP_MESSAGE_EXPIRATION"

To learn more about Connect event types and available data filters, see About Connect: Supported Event Types and Connect Filters in our Connect API reference.