SparkLoop
Search…
Webhoks
Webhooks are used to send events from SparkLoop to your server. We send a POST HTTP request with a JSON payload when specific events occur.

Create a webhook

To create a webhook:
  • go to your campaign dashboard > Settings > Webhooks
  • enter the URL of your webhook and choose which events you want to receive

Update/delete a webhook

To update or delete a webhook hover over the three dots to the right of the webhook to open the settings menu and click on the link to update or delete.

Test a webhook

To test a webhook hover over the three dots to the right of the webhook to open the settings menu and click on "Send test webhook"

Events

We currently send two types of events:

new_referral

Is sent when a new referral is tracked
1
{
2
"type": "new_referral",
3
"campaign_id": "MF6319db9890",
4
"subscriber": {
5
"id": "sub_hjdgc74u",
6
"first_name": "John",
7
"name": "John Doe",
8
"email": "[email protected]",
9
"referral_code": "ada90f39",
10
"referral_link": "https://mywebsite.com?rh_ref=ada90f39",
11
"referred": true,
12
"tot_referrals": 0,
13
"next_reward": 2,
14
"created_at": 1564400550
15
},
16
"referrer": {
17
"id": "sub_93ehus8h",
18
"first_name": "John",
19
"name": "John Smith",
20
"email": "[email protected]",
21
"referral_code": "f9464199",
22
"referral_link": "https://mywebsite.com?rh_ref=f9464199",
23
"referred": false,
24
"tot_referrals": 4,
25
"next_reward": 1,
26
"created_at": 1564403873
27
}
28
}
Copied!

reward_unlocked

Is sent when a subscriber hits a milestone and unlocks a reward
1
{
2
"type": "reward_unlocked",
3
"campaign_id": "MF6319db9890",
4
"subscriber": {
5
"id": "sub_hjdgc74u",
6
"first_name": "John",
7
"name": "John Doe ",
8
"email": "[email protected]",
9
"referral_code": "f9464199",
10
"referral_link": "https://mywebsite.com?rh_ref=f9464199",
11
"referred": true,
12
"tot_referrals": 4,
13
"next_reward": 2,
14
"created_at": 1564403873
15
},
16
"reward": {
17
"id": "reward_cdebf4f013",
18
"name": "2018 Private Report: State of the Ecommerce",
19
"referrals": 4,
20
recurring: false
21
}
22
}
Copied!

Errors

Please send back a blank response with a status code of 200. All not-200 responses will be considered errors.
If a webhook fails, we will try to deliver it 3 times over a period of 5 minutes.
Last modified 2mo ago