Integration Steps
A comprehensive guide to integrating your Web app or Web Platform with AppVirality’s dedicated WEB API.
This would be fairly quicker & easier as compared to other platforms’ integration procedures.
AppVirality supports Web Referral program through API.
Refer to the API documentation for details.
The base URL for running web referrals is: https://api.appvirality.com
STEP 2: Using SHARE URL to INVITE
STEP 4: Register Conversion Event
STEP 1: Register Web User
When a user clicks on “Invite & Earn” button on web, please check if the user is already ‘Logged In’ or not. If not, prompt the user to LogIn to begin referring.
On Signup, call AppVirality API with user details where EmailId field is mandatory. All the provided input parameters will be stored only if the user email has not already been registered.
For already registered users, you must be having the userkey. Please send the userkey in input parameter to get the user referral link and referral code.
In response to the call, basic information along with the user’s referral link is provided, which is required for further communication with the API.
api.appvirality.com/v2_0/registerwebuserapplication/jsonInput Parameters
| Input Params | Description |
|---|---|
| apikey | API Key of the App Get it from Dashboard › App Details |
| userkey (optional) | User Key of the existing user provide this value for already registered users |
| privatekey | Private key for API requests Get it from: Dashboard › App Details › Click App Settings › Scroll down to Advanced Settings |
| ReferrerCode(optional) | Referrer’s Referral Code: user will be attributed to his friend(one who invited) when on providing his referral code |
| avClick (optional) | AppVirality Click ID, this is query string parameter “avclk” value. This will be available if a user visits your website by clicking on the referral link. If the user is already registered with you don’t send this parameter |
| isExistingUser (optional) | Set this as True, if you identify the user as an existing user (this is useful if you don’t want to reward existing users) |
| EmailId | User Email Address, with which user has signed up with |
| AppUserName (optional) | Name of the App user (is required to personalize the referral messages). If the name consists of special characters, then send the content in URI encoded format. |
| UserIdInstore (optional) | This is the ID with which you recognize the user uniquely in your store |
| ProfileImage (optional) | User profile picture URL, required to personalize the referral messages |
| Phone (optional) | User mobile Number (Digits Only) |
| City (optional) | User current City, required to apply location targeting |
| State (optional) | User current State, required to apply location targeting |
| Country (optional) | User current Country, required to apply location targeting |
{"userkey": "176502556c624614b913a62400ab4d7e","shareurl":"http://r.appvirality.com/67bfc-da","referralcode":"67bfc","isExistingUser":true,"hasReferrer":true,"success": true,"message": null}Response Parameters
| Output Params | Description |
|---|---|
| userkey | User Key for the an App user - a unique identifier for every App User recorded |
| shareurl | Referral Link of the user |
| referralcode | Referral Code |
| isExistingUser | (Boolean) This will be True, if the user is already registered with AppVirality |
| hasReferrer | (Boolean) This will be “True” if the user has a referrer |
| success | (Boolean) Status of the API call |
| message | Any details on the API call activity |
STEP 2: Using SHARE URL to INVITE
Use the share URL received in STEP-1 and append it to the share message intended for personalizing the “Invite Friends” feature on your web platform.
Example message: “Register with xyz and earn $10 reward, use my referral link to get it: http://r.appvirality.com/67bfc-da”
This will reward the users based on the configured Campaign Reward Rules.
STEP 3: Get Referrer Details
This is to show welcome messages to the new user by showing his referrer name and profile picture. Use “avclk” received in URL query parameters to complete this call.
This call is useful for a lot of other purposes too, wherein you’d like to personalize the customer journey. This call helps you with the details of the referrer to a newly acquired customer, if he has any.
api.appvirality.com/v2_0/getreferrer/{avClick}application/jsonContent-Type application/json
Input Parameters:
avClick = AppVirality Click ID, this is query string parameter avclk value - and this will be available when a user visits your website by clicking on a referral link
v2_0/getreferrer/olc-2f36{"userkey": "2e6cf59c57d14f50b1ffa62000d9d69a","UserIdInstore": null,"name":"my Name","email":"mymail@domain.com","referralcode":"67bvc","profileimage":null,"success": true,"message": null}Response Parameters
| Output Params | Description |
|---|---|
| userkey | User Key of the Referrer |
| UserIdInstore | ID of the Referrer in your App (helps to identify users on dashboard as you do in your app) |
| name | Name of the referrer |
| Email of the referrer | |
| referralcode | Invite Code of the Referrer |
| profileimage | Profile picture of the Referrer |
| success | (Boolean) Status of the API call |
STEP 4 - Register Conversion Event
After successful completion of “registerwebuser” API call, you are ready to send the conversion event. Please visit the Register Conversion Event on how to Register Conversion event.
This will reward the users based on the configured Campaign Reward Rules.
STEP 5 - Get Referrer/Friend Balance
Use this call to check the referrer/friend available balance and under review credits. If the user participated in multiple campaigns, it returns multiple records with reward details for each campaign.
Please visit the Get User Balance i.e. Friend/Referrer on how to get user balance.
Live Sample : http://referral.appvirality.com
STEP 6: Register e-mail for Testing
Use this call to register an email as a test user. This will allow to register using the same email after reset.
NOTE - It is mandatory to click on “Add Test Device” button in the AppVirality Dashboard › Testing page before you execute this call. It will give a window of 30 sec to register the email for testing.
api.appvirality.com/v2_0/addtestdeviceapplication/jsonContent-Type application/json
{"apikey":"004d37de619e41777eb7a4f800715468","privatekey":"0ef86e6ee69017abb18aa50900554688","email":"test1998@gmail.com"}Input Parameters
| Input Params | Description |
|---|---|
| apikey | API Key of the App, get this from Dashboard > App Details |
| privatekey | Private key for API requests, get this from: Dashboard › App Details › Change Settings › Advanced Settings |
| User Email Address, with which he has signed up |
{ "success": true, "message": null}Response Params
| Output Params | Description |
|---|---|
| success | returns true on successful execution |
| message | Information regarding API call (if relevant) |
THAT CONCLUDES THE WEB REFERRAL INTEGRATION SETUP
You should now explore the Testing Guide for testing your integration & troubleshooting your Referral Campaign
