Skip to main content

Configuration Requirements

You can get your OneSignal App ID and REST API Key by following these instructions.

Profile Requirements

To deliver a message to a recipient over OneSigal, Courier must be provided the recipient’s PlayerId or ExternalId. This ID should be included in the recipient profile as oneSignalPlayerID or oneSignalExternalUserId.
{
  "message": {
    "to": {
       "oneSignalPlayerID": "..."
    }
  }
}
// or
{
  "message": {
    "to": {
       "oneSignalExternalUserId": "..."
    }
  }
}

Limiting Data Payload

OneSignal imposes a limit to push notification payloads. When sending push notifications through automated workflows that include batching, data payloads can become too large to pass down to OneSignal which will result in a failed send.

Data Mapping

Push channels can have data mapping enabled to customize which data you want passed down to the push channel provider.

OneSignal Data Mapping

With data mapping, we can access values from the message payload by explicitly stating which values you want passed. This can be useful to help limit how much data is passed to the push provider. For example, you can either pass the entire data payload as
data: request("data")
or explicitly choose which values to pass down:
{
      data: {
        "firstName": data("firstName"), // accesses the data object
        "email": profile("email"), // accesses the profile object
        "template": request("template") // accesses the entire request received.
      }
    }