Programmatic Notifications
In addition to the OneSignal web portal you may use OneSignal's Server REST API to send transactional push notifications programmatically.
OneSignal's REST API is documented at https://documentation.onesignal.com/reference
When sending notifications through OneSignal's API, you may target users by specifying predefined segments, filtering by parameters, or specific OneSignal IDs or other identifiers.
Send to Users
Sending notifications to all devices of a user is the most common use case when sending transactional or targeted notifications. You can easily do that using OneSignal ID or External ID. See User Management for details on configuring each of these strategies
Programmatically send notification to specific users
Send to Segments
Segments are the most common way to target large groups of devices. You may specify which segments you want to target and, optionally, which ones you don't want to receive the notification. See Data Tags (Subscription Management) for details on using tags to create segments, both programmatically and by allowing users to self-subscribe.
Programatically send notification to segments
Send to Specific Devices
You can programmatically send a push notification to a specific device based on Push Subscription ID. See User Management for details on how to retrieve the Push Subscription ID for a specific device.
Updated 5 months ago