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 OneSignal Integration 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. Send push covers the model. OneSignal addresses the recipient by PlayerId or ExternalId. Store either one once withPOST /profiles/{user_id}, which merges into the profile and creates it if it doesn’t exist:
- Player ID
- External ID
The id OneSignal assigned the device.
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
- Send to user id
- Send to
oneSignalPlayerID
Courier reads
oneSignalPlayerID off the saved profile, so preferences apply and the value can change without touching this code.Overrides
How overrides work covers the two levels and which one wins. Push channel overrides 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 caps the size of a push payload. In automated workflows that batch sends, a data payload can exceed that cap and the send fails. Enable data mapping on the push channel to choose which fields reach the provider. Data mapping covers the template setting.
OneSignal Data Mapping
Provider details
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.