Ravenhub API
post
https://api.ravenhub.io
/company/:appId/subscribers/:subscriberId/events/:eventId
Send Notification
curl
javascript
1
curl https://api.ravenhub.io/company/MK6ey8wi3b/subscribers/foo1/events/owtDEKN0iP \
2
-H 'Content-Type: application/json' \
3
-d '{ "priority" : "Critical" }'
4
​
Copied!
1
const subscriberId = 'foo1';
2
let endpoint = 'https://api.ravenhub.io/company/MK6ey8wi3b/subscribers/'
3
+ subscriberId + '/events/owtDEKN0iP';
4
5
axios.post(endpoint, { "priority" : "Critical" }, {
6
headers: {'Content-type': 'application/json'}
7
});
8
​
Copied!
post
https://api.ravenhub.io
/company/:appId/broadcasts/:broadcastId
Send Broadcast
curl
javascript
1
curl https://api.ravenhub.io/company/MK6ey8wi3b/broadcasts/owtDEKN0iP \
2
-H 'Content-Type: application/json' \
3
-d '{"notifications":[{"subscriberId":"foo1"},{"subscriberId":"foo2"}]}'
4
​
Copied!
1
var endpoint = 'https://api.ravenhub.io/company/MK6ey8wi3b/broadcasts/owtDEKN0iP';
2
/*
3
The "data" key is optional within each notification
4
object in the notifications array below.
5
*/
6
​
7
var postBody =
8
{
9
"notifications" : [
10
{
11
"subscriberId" : "foo1",
12
"data" : {
13
"val1" : "hello again",
14
"val2" : "hi",
15
"urlvar" : "https://google.com"
16
}
17
},
18
{
19
"subscriberId" : "foo2",
20
"data" : {
21
"val1" : "hello again",
22
"val2" : "hi",
23
"urlvar" : "https://yahoo.com"
24
}
25
}
26
]
27
}
28
axios.post(endpoint, postBody, {
29
headers: {'Content-type': 'application/json'}
30
});
31
​
Copied!
Last modified 1yr ago