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.
Configuring Webhooks
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
OR
Navigate to:
- ‘Reward Configuration’ from your Dashboard
- Select the appropriate Campaign from the dropdown
- Select API under Choose your rewarding/payment system

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
On Conversion Success (Conversion Event 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.
{ "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
| Parameter | Description |
|---|---|
| campaignid | Unique Campaign ID |
| campaignname | Name of the Campaign |
| growthhack | Growth Hack Type |
| eventname | Signup, Conversion & Any defined Custom Events |
| extraInfo | Info provided during the Conversion Event. Data will be Uri encoded. |
| friend | Object that consists Friend details along with his reward information obtained through Referral Program |
| userkey | Userkey of the friend |
| emailid | Email of the friend |
| name | Name of the friend |
| storeuserid | This is the ID with which you recognize the user uniquely in your store. |
| rewardid | Reward ID, to Track the Reward and Distribution |
| rewardtype | Type of Reward (Coupon, InstoreCredits, Other) |
| rewardeddate | Reward Initiated Date (eg: 31-Mar-2017) |
| reward | amount of money to reward (null when non-monetary incentive is used) |
| months | No.of months to reward (null when non-monetary incentive is used) |
| rewardunit | Currency Unit of the Reward |
| rewarddtlid | Reward detail ID |
| amount | amount of money to reward (null when non-monetary incentive is used) |
| couponcode | Coupon code dispatched to Friend as a reward. Only when the Reward type is coupon. |
| expires | Coupon expiry date. |
| location | Friend location (City, State, Country). |
| reachedmaxlimit | Will be True, if Referrer has already obtained Maximum Reward Cap for Referral Program. |
| referrer | Object that consists Referrer details along with his reward information obtained through Referral Program |
| userkey | Userkey of the referrer |
| emailid | Email of the referrer |
| name | Name of the referrer |
| storeuserid | This is the ID with which you recognize the user uniquely in your store. |
| rewardid | Reward ID, to Track the Reward and Distribution |
| rewardtype | Type of Reward (Coupon, InstoreCredits, Other) |
| rewardeddate | Reward Initiated Date (eg: 31-Mar-2017) |
| reward | amount of money to reward (null when non-monetary incentive is used) |
| months | No.of months to reward (null when non-monetary incentive is used) |
| rewardunit | Currency Unit of the Reward |
| rewarddtlid | Reward detail ID |
| amount | amount of money to reward (null when non-monetary incentive is used) |
| couponcode | Coupon code dispatched to Friend as a reward. Only when the Reward type is coupon. |
| expires | Coupon expiry date. |
| location | Friend location (City, State, Country). |
| reachedmaxlimit | Will be True, if Referrer has already obtained Maximum Reward Cap for Referral Program. |
On User Reward Event (User Reward Webhook URL)
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.
{ "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
| Parameter | Description |
|---|---|
| userkey | Userkey of the user |
| emailid | Email of the user |
| name | Name of the user |
| storeuserid | This is the ID with which you recognize the user uniquely in your store. |
| rewardid | Reward ID, to Track the Reward and Distribution |
| rewardtype | Type of Reward (Coupon, InstoreCredits, Other) |
| rewardeddate | Reward Initiated Date (eg: 31-Mar-2017) |
| reward | amount of money to reward (null when non-monetary incentive is used) |
| months | No.of months to reward (null when non-monetary incentive is used) |
| rewardunit | Currency Unit of the Reward |
| rewarddtlid | Reward detail ID |
| amount | amount of money to reward (null when non-monetary incentive is used) |
| couponcode | Coupon code dispatched to Friend as a reward. Only when the Reward type is coupon. |
| expires | Coupon expiry date. |
| location | Friend location (City, State, Country). |
| reachedmaxlimit | Will be True, if Referrer has already obtained Maximum Reward Cap for Referral Program. |
You may need to test/inspect/debug your webhook integration while setting up the above configurations.

