Push Notifications
Create Subscription
REST API
- Overview
- Limits
- Errors
- GETGet Account Settings
- Authentication
- Users
- Chat
- Content
- Push Notifications
- Custom Objects
- Address Book
- AI
Push Notifications
Create Subscription
Create device based subscriptions.
POST
/
subscriptions.json
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: 1e0bad9d9830c038ea19f12d83fca4e984012bba" \
-d '{
"notification_channel":"apns",
"push_token":{
"environment":"development",
"client_identification_sequence":"1054929587f29c856fa0137f634cc0a5ec77901f4baaf2f3c1785d05ae114455",
"bundle_identifier":"com.quickblox.myawesomeapp"
},
"device":{
"platform":"ios",
"udid":"2343af3433aa3a4fsv"
}
}' \
https://api.quickblox.com/subscriptions.json
[
{
"subscription": {
"id": 59715257,
"device": {
"udid": "2343af3433aa3a4fsv",
"client_identification_sequence": "1054929587f29c856fa0137f634cc0a5ec77901f4baaf2f3c1785d05ae114455",
"platform": {
"name": "ios"
},
"bundle_identifier": "com.quickblox.myawesomeapp"
},
"notification_channel": {
"name": "apns"
}
}
}
]
A single user can have up to 10 subscriptions on different devices.
Body Parameters
Declare which notification channels could be used to notify user about events. Possible values are:
apns
, apns_voip
, gcm
, and email
. Determine application mode. It allows conveniently separate development and production modes. Possible values are:
development
and production
. A unique identifier for client’s application. In iOS, this is a Bundle Identifier. In Android, a package ID.
A device registration token generated by the APNS or GCM/FCM. The token can be unregistered by the APNS or GCM/FCM anytime. In this case, the device should be registered again and obtain a new token. When a new token is obtained, a new subscription should be created.
Platform of the device, which is the source of application running. Possible values are:
ios
and android
. UDID (Unique Device Identifier) of the device that is the source of application running. This must be any sequence uniquely identifying a particular device. This is needed to support schema: 1 User => Multiple devices.
Headers
A user or application session token. See our Authentication page to learn more about session tokens. Must be used either QB-Token or Authorization.
Responses
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: 1e0bad9d9830c038ea19f12d83fca4e984012bba" \
-d '{
"notification_channel":"apns",
"push_token":{
"environment":"development",
"client_identification_sequence":"1054929587f29c856fa0137f634cc0a5ec77901f4baaf2f3c1785d05ae114455",
"bundle_identifier":"com.quickblox.myawesomeapp"
},
"device":{
"platform":"ios",
"udid":"2343af3433aa3a4fsv"
}
}' \
https://api.quickblox.com/subscriptions.json
[
{
"subscription": {
"id": 59715257,
"device": {
"udid": "2343af3433aa3a4fsv",
"client_identification_sequence": "1054929587f29c856fa0137f634cc0a5ec77901f4baaf2f3c1785d05ae114455",
"platform": {
"name": "ios"
},
"bundle_identifier": "com.quickblox.myawesomeapp"
},
"notification_channel": {
"name": "apns"
}
}
}
]
Was this page helpful?
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: 1e0bad9d9830c038ea19f12d83fca4e984012bba" \
-d '{
"notification_channel":"apns",
"push_token":{
"environment":"development",
"client_identification_sequence":"1054929587f29c856fa0137f634cc0a5ec77901f4baaf2f3c1785d05ae114455",
"bundle_identifier":"com.quickblox.myawesomeapp"
},
"device":{
"platform":"ios",
"udid":"2343af3433aa3a4fsv"
}
}' \
https://api.quickblox.com/subscriptions.json
[
{
"subscription": {
"id": 59715257,
"device": {
"udid": "2343af3433aa3a4fsv",
"client_identification_sequence": "1054929587f29c856fa0137f634cc0a5ec77901f4baaf2f3c1785d05ae114455",
"platform": {
"name": "ios"
},
"bundle_identifier": "com.quickblox.myawesomeapp"
},
"notification_channel": {
"name": "apns"
}
}
}
]