OneSignal

FREE
By dimashirokov
Updated 6 months ago
Communication
1.9/10
Popularity Score
57938ms
Latency
-
Success Rate

OneSignal API Documentation

Add push notification service to websites and apps.

View API Details
POSTaddDevice
POSTaddDevicePurchase
POSTcancelNotification
POSTcreateApp
POSTcreateDeviceSession
POSTeditDevice
POSTgetApp
POSTgetApps
POSTgetDevice
POSTgetDevices
POSTgetNotification
POSTgetNotifications
POSTnotificationTest
POSTsendNotification
POSTtrackNotificationOpen
POSTupdateApp
POSTupdateDeviceSessionLength
POSTaddDevice

Register a new device to one of your OneSignal apps

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Required Parameters
appIdCREDENTIALS
REQUIREDRequired: Your app id for this device.
deviceTypeSELECT
REQUIREDRequired: The device's platform: `0` = iOS; `1` = Android; `2` = Amazon; `3` = WindowsPhone(MPNS); `4` = Chrome Apps / Extensions; `5` = Chrome Web Push; `6` = WindowsPhone(WNS); `7` = Safari; `8` = Firefox; `9` = MacOS
Optional Parameters
tagsARRAY
OPTIONALOptional: Custom tags for the player. Only support string key value pairs. Does not support arrays or other nested objects. Example: `{"foo":"bar","this":"that"}`.
notificationTypesSELECT
OPTIONALOptional: `1` = subscribed; `-2` = unsubscribed. iOS - These values are set each time the user opens the app from the SDK. Use the SDK function set Subscription instead. Android - You may set this but you can no longer use the SDK method setSubscription later in your app as it will create synchronization issues.
coordinatesMAP
OPTIONALOptional: Latitude and Longitude of the device, used for geotagging to segment on. Example: 51.514084206610455, -51.514084206610455
languageSTRING
OPTIONALOptional: Language code. Typically lower case two letters, except for Chinese where it must be one of zh-Hans or zh-Hant. Example: `en`.
deviceOsSTRING
OPTIONALOptional: Device operating system version. Example: `7.0.4`.
adIdSTRING
OPTIONALOptional: The ad id for the device's platform: Android = `Advertising Id`; iOS = `identifierForVendor`; WP8.0 = `DeviceUniqueId`; WP8.1 = `AdvertisingId`.
amountSpentSTRING
OPTIONALOptional: Amount the user has spent in USD, up to two decimal places.
createdAtDATEPICKER
OPTIONALOptional: Unixtime when the player joined the game.
lastActiveDATEPICKER
OPTIONALOptional: Unixtime when the player was last active.
testTypeSELECT
OPTIONALOptional: This is used in deciding whether to use your iOS Sandbox or Production push certificate when sending a push when both have been uploaded. Set to the iOS provisioning profile that was used to build your app. `1` = Development; `2` = Ad-Hoc. Omit this field for App Store builds.
coordinatesMAP
OPTIONALOptional: Latitude and Longitude of the device, used for geotagging to segment on. Example: 51.514084206610455, -51.514084206610455
identifierSTRING
OPTIONALOptional: Push notification identifier from Google or Apple. For Apple push identifiers, you must strip all non alphanumeric characters. Example: `ce777617da7f548fe7a9ab6febb56`.
deviceModelSTRING
OPTIONALOptional: Device make and model. Example: `iPhone5,1`.
timezoneNUMBER
OPTIONALOptional: Number of seconds away from UTC. Example: `-28800`.
adIdSTRING
OPTIONALOptional: The ad id for the device's platform: Android = `Advertising Id`; iOS = `identifierForVendor`; WP8.0 = `DeviceUniqueId`; WP8.1 = `AdvertisingId`.
sessionCountNUMBER
OPTIONALOptional: Number of times the user has played the game, defaults to 1.
amountSpentSTRING
OPTIONALOptional: Amount the user has spent in USD, up to two decimal places.
createdAtDATEPICKER
OPTIONALOptional: Unixtime when the player joined the game.
notificationTypesSELECT
OPTIONALOptional: `1` = subscribed; `-2` = unsubscribed. iOS - These values are set each time the user opens the app from the SDK. Use the SDK function set Subscription instead. Android - You may set this but you can no longer use the SDK method setSubscription later in your app as it will create synchronization issues.
testTypeSELECT
OPTIONALOptional: This is used in deciding whether to use your iOS Sandbox or Production push certificate when sending a push when both have been uploaded. Set to the iOS provisioning profile that was used to build your app. `1` = Development; `2` = Ad-Hoc. Omit this field for App Store builds.
playtimeNUMBER
OPTIONALOptional: Seconds player was running your app.
badgeCountNUMBER
OPTIONALOptional: Current iOS badge count displayed on the app icon.
coordinatesMAP
OPTIONALOptional: Latitude and Longitude of the device, used for geotagging to segment on. Example: 51.514084206610455, -51.514084206610455
deviceOsSTRING
OPTIONALOptional: Device operating system version. Example: `7.0.4`.
sdkSTRING
OPTIONALOptional: Name and version of the plugin that's calling this API method (if any).
languageSTRING
OPTIONALOptional: Language code. Typically lower case two letters, except for Chinese where it must be one of zh-Hans or zh-Hant. Example: `en`.
gameVersionSTRING
OPTIONALOptional: Version of your app. Example: `1.1`.
timezoneNUMBER
OPTIONALOptional: Number of seconds away from UTC. Example: `-28800`.
gameVersionSTRING
OPTIONALOptional: Version of your app. Example: `1.1`.
deviceModelSTRING
OPTIONALOptional: Device make and model. Example: `iPhone5,1`.
adIdSTRING
OPTIONALOptional: The ad id for the device's platform: Android = `Advertising Id`; iOS = `identifierForVendor`; WP8.0 = `DeviceUniqueId`; WP8.1 = `AdvertisingId`.
sdkSTRING
OPTIONALOptional: Name and version of the plugin that's calling this API method (if any).
sessionCountNUMBER
OPTIONALOptional: Number of times the user has played the game, defaults to 1.
Code Snippet
Response ExampleSchema

Install SDK for (Node.js)Unirest

OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication