Skip to content

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.

POSTapi.appvirality.com/v2_0/setuserreferrerapplication/json

Input i.e. Request

{
"apikey":"176502556c624614b913a62400ab4d7e",
"privatekey":"8b05ee42d9c941698bbba44c00cc32d1",
"userkey": "176502556c624614b913a62400ab4d7e",
"EmailId": "",
"UserIdInstore": "",
"ReferrerCode": "mapp2wer",
"avClick": "dsew-mapp2wer"
}

Input Params

Input ParamsDescription
apikeyAPI Key of the App
Get it from DashboardApp Details
privatekeyPrivate key for API requests
Get it from: DashboardApp 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
ReferrerCodeReferrer’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,
"statuscode": 1,
"message":"Success"
}

Response Params

Output ParamsDescription
userkeyUser Key of the App user, assigned by AppVirality - a unique identifier for every App User recorded
shareurlReferral Link of the App user
referralcodeReferral 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
messageInformation regarding API call (if relevant)
status codecode based on status of the API call

Status codes which you will see while using Set User Referrer API

Status codes and description for API responses

Status CodeDescription
0No data found for the search criteria
1Success
5Invalid StoreID or EmailID
13Provided Click ID is Invalid
14Error - Failed to Set Referrer Code
15Referrer Code is his own code
16Referrer is not Eligible to Participate in Campaign
18Is an Existing User
19Referrer Code doesn’t exists
20User Already Attributted