Send Event API
post
https://api.ravenapp.dev
/v1/apps/:app_id/events/send
Send Event

Request Example

1
POST /v1/apps/{{app_id}}/events/send HTTP/1.1
2
Host: https://api.ravenapp.dev
3
Authorization: AuthKey {{secret_key}}
4
Content-Type: application/json
5
6
{
7
"event": "sample_event_1",
8
"user": {
9
"mobile": "+919876543210",
10
"email": "[email protected]",
11
"whatsapp_mobile": "+919876543210", // if empty, `mobile` is considered for whatsapp
12
},
13
"data": {
14
"name": "John Doe",
15
"date": "01 December 2020"
16
}
17
}
Copied!
post
https://api.ravenapp.dev/v1/apps/:app_id/events/bulk_send
Send Event Bulk API
1
POST /v1/apps/{{app_id}}/events/bulk_send HTTP/1.1
2
Host: https://api.ravenapp.dev
3
Authorization: AuthKey {{secret_key}}
4
Content-Type: application/json
5
6
{
7
"event": "sample_event_1",
8
"batch": [
9
{
10
"user": {
11
"mobile": "+919876543210",
12
"email": "[email protected]",
13
"whatsapp_mobile": "+919876543210", // if empty, `mobile` is considered for whatsapp
14
},
15
"data": {
16
"name": "John Doe",
17
"date": "01 December 2020"
18
}
19
},
20
{
21
"user": {
22
"mobile": "+919876543210",
23
"email": "[email protected]",
24
"whatsapp_mobile": "+919876543210", // if empty, `mobile` is considered for whatsapp
25
},
26
"data": {
27
"name": "John Doe",
28
"date": "01 December 2020"
29
}
30
}
31
]
32
}
Copied!

Advanced

If you have any extra parameters that need to be passed in the notification, you can add it in the override object in the request payload.
Here's an example payload where we add extra params - email recipients (cc, bcc) & override the from parameter.
1
{
2
"event": "sample_event_1",
3
"user": {
4
"mobile": "+919876543210",
5
"email": "[email protected]",
6
"whatsapp_mobile": "+919876543210", // if empty, `mobile` is considered for whatsapp
7
},
8
"data": {
9
"name": "John Doe",
10
"date": "01 December 2020"
11
},
12
"override" : {
13
"email" : {
14
"from" : { // overriding `from`
15
"name" : "Adam",
16
"address" : "[email protected]"
17
},
18
"cc" : [
19
{
20
"name" : "Michael",
21
"address" : "[email protected]"
22
}
23
],
24
"bcc" : [
25
{
26
"name" : "Max",
27
"address" : "[email protected]"
28
}
29
]
30
}
31
}
32
}
Copied!
Provider Override
You can also override API payload being sent to the provider. Parameter passed in override will be merged with the final API call made to the provider. Currently overriding API payload has been enabled for Push Channel.
Here's an example where we override API payload of Onesignal provider onesignal_test and pass additional parameters - big_picture & android_channel_id
1
{
2
"event": "sample_event_1",
3
"user": {
4
"mobile": "+919876543210",
5
"onesignal_external_id" : "john123"
6
},
7
"data": {
8
"name": "John Doe",
9
"date": "01 December 2020"
10
},
11
"override" : {
12
"providers" : {
13
"onesignal_test" : { // provider_name
14
"payload" : {
15
"big_picture" : "<url>",
16
"android_channel_id" : "<channel_uuid>"
17
....
18
}
19
}
20
}
21
}
22
}
Copied!