HomeSaaS Referral Program GuideAdvanced ConfigurationsWebHook Configuration

WebHook Configuration

Campaign Rewards can be configured in the AppVirality Dashboard to be reported as server-side callbacks. This is considered to be a very secure and prominent practice.

Important Note

Make the Redeem Rewards API call for the user rewards redemption, to communicate AppVirality that the user’s rewards have been redeemed, after:

  • You have received the Webhook on your HTTP endpoint
  • Translated the Payload/JSON data into User rewards info
  • Updated the appropriate User Wallet/Account, in accordance to the above translated User Rewards

Reward notifications through Web hooks are user-defined HTTP post backs which are triggered on pre-defined events to receive the reward/event information.

Each web hook expects a HTTP URL to deliver payload (web hook data).

To configure the Web hook URLs navigate to:

  • App Details on your AppVirality Dashboard by clicking on left menu,
  • Select the desired campaign from the available list (these are the ones which are either in Drafted or Live status, implying that these are the only ones which you may have created – even if partially)
  • Click on More, an array of new options shall show up
  • Click on Notifications
  • Switch over to the Web Hooks tab

Dashboard >> App Details >> Select Appropriate Campaign and Click on More on the campaign card >> Click on Notifications >> Switch to Web Hooks tab

SaaS_Webhooks

OR

Navigate to: 

  • Reward Configuration‘ from your Dashboard
  • Select the appropriate Campaign from the dropdown
  • Select API under Choose your rewarding/payment system 

SaaS Webhooks

NOTE: Web hook call expects HTTP 200 OK Status Code as response.

In case of any failure, the re-send call attempt is made for a maximum of 5 times

Automatic Retries

In case of any failure, AppVirality will set off automatic retries as below:

Retry Time
1 5 minutes after the failure
2 30 minutes after the previous retry
3 120 minutes after the previous retry
4 360 minutes after the previous retry

The webhook configuration requires only 2 webhook URLs, where all would exist and operate on a mutually exclusive basis, i.e. they do not have any inter dependencies when it comes to their individual operation. These two webhooks shall hence forth be identified as follows:

  • Conversion Event URL
  • User Reward Webhook URL

This callback is received when a successful Conversion Event is triggered. The payload contains information regarding the rewards received by Referrer and Friend.

This webhook will get fired immediately; if the user is eligible for the reward, on receiving the conversion event.

NOTE: Conversion webhook will get fired immediately on successful conversion. Fraud check will not happen by the time this webhook get’s fired. Please use Check Reward status API before rewarding the users.

Method POST
Content-Type application/json
{
	"campaignid": "4619",
	"campaignname": "SaaS Referral",
	"growthhack": "SaaS_Referrals",
	"eventname": "Signup",
	"extrainfo": "Extra Info",
	"friend": {
		"userkey": "10fcef9c79c9abc89acda32a00da12345",
		"emailid": "friend@mail.com",
		"name": "User Name",
		"storeuserid": "101234",
		"rewardid": "1234",
		"rewardtype": "InstoreCredits",
		"rewardeddate": "3/31/2017 7:08:50 PM",
		"reward": "10",
		"months": "20",
		"rewardunit": "% Discount",
		"couponcode": "",
		"expires": "",
		"reachedmaxlimit": "false",
		"location": "User Location",
		"rewarddetails": [
			{
				"rewarddtlid": "1234",
				"amount": "10",
				"rewardeddate": "3/31/2017 7:08:50 PM",
				"eventname": "Signup"
			}
		]
	},
	"referrer": {
		"userkey": "10fcef9c79c9abc89acda32a00da12345",
		"emailid": "referrer@mail.com",
		"name": "User Name",
		"storeuserid": "101234",
		"rewardid": "1234",
		"rewardtype": "InstoreCredits",
		"rewardeddate": "3/31/2017 7:08:50 PM",
		"reward": "4",
		"months": "4",
		"rewardunit": "% Discount",
		"couponcode": "",
		"expires": "",
		"reachedmaxlimit": "false",
		"location": "User Location",
		"rewarddetails": [
			{
				"rewarddtlid": "1234",
				"amount": "4",
				"rewardeddate": "3/31/2017 7:08:50 PM",
				"eventname": "Signup"
			}
		]
	}
}
Payload Parameters Explained

Triggers on User meeting the eligibility criteria for the incentives configured in the campaign. The payload contains reward details which is are to be updated for the user.

Method POST
Content-Type application/json
{
	"userkey": "10fcef9c79c9abc89acda32a00da12345",
	"emailid": "user@mail.com",
	"name": "User Name",
	"storeuserid": "101234",
	"rewardid": "1234",
	"rewardtype": "InstoreCredits",
	"rewardeddate": "3/31/2017 7:11:23 PM",
	"reward": "4",
	"months": "4",
	"rewardunit": "% Discount",
	"couponcode": "",
	"expires": "",
	"reachedmaxlimit": "false",
	"location": "User Location",
	"rewarddetails": [
		{
			"rewarddtlid": "1234",
			"amount": "50",
			"rewardeddate": "3/31/2017 7:11:23 PM",
			"eventname": "Signup"
		}
	]
}
Payload Parameters Explained

You may need to test/inspect/debug your webhook integration while setting up the above configurations.

Was this article helpful to you? Yes No