Skip to main content

Prerequisites

Setup

1

Get your OneSignal keys

In OneSignal, open accounts and keys and copy your App ID and REST API Key.
2

Configure in Courier

Open the in Courier, enter your App ID and REST API Key, then click “Save.”

Profile requirements

Device tokens live on the user profile rather than on the send, so one profile can hold tokens for several devices and every push provider reads them from the same place. covers the model. OneSignal addresses the recipient by PlayerId or ExternalId. Store either one once with , which merges into the profile and creates it if it does not exist:
The id OneSignal assigned the device.
Then send to user_id and Courier resolves the address. For a one-off with no stored profile, pass it inline instead: "to": { "oneSignalPlayerID": "YOUR_ONESIGNAL_PLAYER_ID" }.

Send by user id

The call in every language, and the rest of the profile object.

Send to a recipient

Courier reads oneSignalPlayerID off the saved profile, so preferences apply and the value can change without touching this code.

Overrides

covers the two levels and which one wins. lists the fields every push provider takes. A provider override changes the request body Courier sends to OneSignal’s API, and takes any field supported by OneSignal’s Create notification endpoint.

Data mapping

OneSignal imposes a limit to push notification payloads. When sending push notifications through automated workflows that include batching, data payloads can become too large, which will result in a failed send. Enable data mapping on the push channel to choose which fields reach the provider. covers the template setting.

OneSignal Data Mapping

Provider details

Courier recommends routing to the channel. Naming this key in routing.channels instead is supported, and sends through just this provider.

Send to a specific provider

When that is worth doing, and what you give up: failover, channel priority, and providers you add later.