-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Requirements:
Not clear
Not implemented
Not implemented
Request:
POST /api/v1/notifications
Content-Type: application/json
notification : {
text : ...,
payload : {
type : ...
...
}
...
},
filter : {
...
}
Response:
Status: 200 OK
notification:{
id: "545e556514a01fbc16773558"
}
Allows different resources to be opened via push notifications:
Moreover you could make client to open URL when user clicks on push notification.
For resource notification types you should send id of resource in payload parameters.
Example:
POST /api/v1/notifications
Content-Type: application/json
notification : {
text : "Some text",
payload : {
type : "item",
id : "item_id"
}
},
filter : {
platform : [
"ios",
"android",
"wp"
]
}
For URL notification you could set in which browser should the URL be opened and browser title.
Example:
POST /api/v1/notifications
Content-Type: application/json
notification : {
text : "Custom text",
payload : {
type : "url",
url : "example.com",
default_browser : true (for Default Browser) / false (for Internal Browser),
browser_title : "Example"
}
},
filter : {
platform : [
"ios",
"android",
"wp"
]
}
Use JSON format for filter request param. You can filter by following params:
- service
- device_id
- platform
- locale
- country
- app_version
You could use keyword "except" for filtering attributes.
For "app_version" param you can use "=", ">", "<", "<=", ">=", "~>".
Possible values of platform: "ios", "android", "wp".
Specify device_id if you want to send notification to a certain device.
Filter 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)
{
"platform" : "ios",
"country" : "sg",
"version" : ["<= 2","~> 4"]
}
Filter all android devices from all countries except Bulgaria
{
"platform" : "android",
"country" : {
"except" : "bg"
}
}