HomeAppVirality DocsAppVirality APIsSet User Referrer

Set User Referrer

This API call shall allow you to attribute a Referrer to a particular user


Most apps have enabled the option to allow users to enter the Invite Code separately through the app. This is pretty much a manual intervention of sorts.

Among all awesome things, AppVirality helps you do the same thing – with a simple API call, which you can cascade against an In-App field. A user has to simply enter the Invite Code he/she received, & the Referrer of the user shall then be set.

 

Base URL  https://api.appvirality.com

 POST         /v2_0/setuserreferrer

Content-Type application/json


Input i.e. Request

{
"apikey":"176502556c624614b913a62400ab4d7e",
"privatekey":"8b05ee42d9c941698bbba44c00cc32d1",
"userkey": "176502556c624614b913a62400ab4d7e",
"EmailId": "",
"UserIdInstore": "",
"ReferrerCode": "mapp2wer",
"avClick": "dsew-mapp2wer"
}
Input Params
Input Params Description
apikey API Key of the App 
Get it from Dashboard >> App Details
privatekey Private key for API requests 
Get it from: Dashboard >> App Details >> Click App Settings >> Scroll down to Advanced Settings
userkey
(conditional)
User Key of the App user, assigned by AppVirality – a unique identifier for every App User recorded
EmailId
(conditional)
Email of the User, updated to AppVirality
UserIdInstore
(conditional)
Store Id of the App user, updated to AppVirality – a unique identifier of the user in your App
ReferrerCode 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 is redirected to App/Website by clicking on the referral link. If the user is already registered with you don't send this parameter
conditional – One of the conditional parameters is mandatory to identify the user. Priority for user identification is userkey, UserIdInstore and EmailId


Response

{
  "userkey": "176502556c624614b913a62400ab4d7e",
  "shareurl": "http://r.appvirality.com/mapp2fag-da",
  "referralcode": "mapp2fag",
  "isExistingUser": false,
  "hasReferrer": true,
  "success": true,
  "message": null
}
Response Params
Output Params Description
userkey User Key of the App user, assigned by AppVirality – a unique identifier for every App User recorded
shareurl Referral Link of the App user
referralcode Referral Code of the App user
isExistingUser (Boolean) This will be True, if the user is identified as an already registered user/device with Appvirality
hasReferrer (Boolean) This will be True if the user has a referrer
success (Boolean) Status of the API call. This will be true when the attribution is successful
message Information regarding API call (if relevant)
Was this article helpful to you? Yes 1 No