Ravenhub API
post
https://api.ravenhub.io
/company/:appId/subscribers/:subscriberId/events/:eventId
Send Notification
curl
javascript
curl https://api.ravenhub.io/company/MK6ey8wi3b/subscribers/foo1/events/owtDEKN0iP \
-H 'Content-Type: application/json' \
-d '{ "priority" : "Critical" }'
​
const subscriberId = 'foo1';
let endpoint = 'https://api.ravenhub.io/company/MK6ey8wi3b/subscribers/'
+ subscriberId + '/events/owtDEKN0iP';
axios.post(endpoint, { "priority" : "Critical" }, {
headers: {'Content-type': 'application/json'}
});
​
post
https://api.ravenhub.io
/company/:appId/broadcasts/:broadcastId
Send Broadcast
curl
javascript
curl https://api.ravenhub.io/company/MK6ey8wi3b/broadcasts/owtDEKN0iP \
-H 'Content-Type: application/json' \
-d '{"notifications":[{"subscriberId":"foo1"},{"subscriberId":"foo2"}]}'
​
var endpoint = 'https://api.ravenhub.io/company/MK6ey8wi3b/broadcasts/owtDEKN0iP';
/*
The "data" key is optional within each notification
object in the notifications array below.
*/
​
var postBody =
{
"notifications" : [
{
"subscriberId" : "foo1",
"data" : {
"val1" : "hello again",
"val2" : "hi",
"urlvar" : "https://google.com"
}
},
{
"subscriberId" : "foo2",
"data" : {
"val1" : "hello again",
"val2" : "hi",
"urlvar" : "https://yahoo.com"
}
}
]
}
axios.post(endpoint, postBody, {
headers: {'Content-type': 'application/json'}
});
​