Requirements:
In progress ...
Request:
POST /api/v1/subscribers/:id?platform={platform}&service={service_name}&token={push_token}
Response:
Status: 201 Created || 204 No Content
To retrieve a push notification's payload you should send the ID of the notification as a parameter.
Allows different resources to be opened via push notifications. Moreover you could make client to open URL when user clicks on push notification. For URL notification you could set in which browser should the URL be opened and browser title. For launching in the default browser set "default_browser" :true
, for internal browser "default_browser" :false
.
Request:
GET /api/v1/events/:id/payload
Response:
Status: 200 OK
{
"payload": {
"type": "image",
"category": "animals",
"watermark": "Our new Hippo is here!!!"
}
}
Request:
POST /api/v1/events
Content-Type: application/json
{
"headers": {
"type": "text",
"text": "New text push received!"
},
"payload": {
"content": "Content text"
},
"target": {
"services": [ "test", "test1" ],
"platforms": [ "ios", "android", "windows" ]
}
}
Response:
Status: 200 OK
notification:{
"id": "545e556514a01fbc16773558"
}
Request:
POST /api/v1/notifications/:id
Response:
Status: 200 OK
notification:{
"id": "545e556514a01fbc16773558"
}
Short text notification message.
Request:
POST /api/v1/notifications
Content-Type: application/json
{
"headers": {
"text": "New LINK push received!"
},
"payload": {
"type": "link",
"url" : "http://example.com",
"default_browser" : true,
"browser_title" : "Custom title"
},
"target": {
"services": ["test", "test1"],
"platforms": ["ios", "android", "wp"]
}
}
Use JSON format for target request param. You can target by following params:
- services
- platforms (Valid: ["windows", "ios", "android"])
- id
- locale
- country
- version
Example: Target all iOS devices from Singapore with application version (less than or equal to 2) or (more than or equal to 4, but less than 5)
{
"platforms" : "ios",
"country" : "sg",
"version" : ["<= 2","~> 4"]
}