Skip to content

Get User Balance i.e. Friend/Referrer

This API Call shall enable you to pull up earnings data for any user


Gets you the individual balance/earnings data for any User - Referrer/Friend

This API call shall help you obtain the complete earnings data of a user at any point in time. It is an important call when thinking from the perspective of personalizing the user experience in the app.

The call shall return individual detailed earnings data, i.e. it will list out rewards pooled together per campaign per growth hack, available to the user. Hence the rewards across multiple growth hacks shall reflect as multiple nested records in the response payload.

POSTapi.appvirality.com/v2_0/getuserbalanceapplication/json

Input i.e. Request

{
"userkey":"588d87d8d9e89ac5d710caf68910ac5d",
"apikey":"7ffdda00fd5c4338a9c1a44e00663648",
"privatekey":"d1e881dc60fa4856be34a44f00d96c9a",
"EmailId": "",
"UserIdInstore": "",
"campaignId": "214",
"growthHack": "Word_of_Mouth"
}

Input Params

Input ParamsDescription
userkey
(conditional)
User Key for the an 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
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
campaignId
(optional)
Unique ID of a campaign (helps you filter rewards)
growthHack
(optional)
Type of Growth Hack (helps you filter rewards)
values: Word_of_Mouth or Loyalty_Program

conditional - One of the conditional parameters is mandatory to identify the user. Priority for user identification is userkey, UserIdInstore and EmailId


Response

{
"userBalance": {
"total": 900, // Total earnings of user
"claimed": 700, // Amount marked rewarded to the user
"pending": 200, // Yet to be rewarded
"growthHacks": [
{
"ghName": "Word_of_Mouth", // growth hack name
"total": 700, // Total earnings of user - for this growth hack
"claimed": 700, // Amount marked rewarded to the user - for this growth hack
"pending": 0, // Yet to be rewarded - for this growth hack
"campaigns": [
{
"campaignId": 214,
"campaignName": "campign",
"total": 700, // Total earnings of user - for this campaign
"claimed": 700, // Amount marked rewarded to the user - for this campaign
"pending": 0, // Yet to be rewarded - for this campaign
"ghName": "Word_of_Mouth",
"rewardUnit": "Rs"
}
]
},
{
"ghName": "Loyalty_Program",
"total": 200,
"claimed": 0,
"pending": 200,
"campaigns": [
{
"campaignId": 215,
"campaignName": "loylcampign",
"total": 200,
"claimed": 0,
"pending": 200,
"ghName": "Loyalty_Program",
"rewardUnit": "Rs"
}
]
}
]
},
"success": true,
"statuscode": 1,
"message": success
}

NOTE

~ preceding a parameter e.g. ~ rewardunit, implies the param is a nested/subset of the most recent non-tilde param, i.e. in this case rewardunit is a sub/nested param under userpoints

Response Params

Output ParamsDescription
successResponse status
messageInformation regarding API call (if relevant)
status codecode based on status of the API call
userBalanceReward detail
~ totalTotal Earnings of the user
~ claimedAmount marked as rewarded
~ pendingAmount yet to be rewarded
~ growthHacksCollection of Rewards detail - per Growth Hack basis
~ campaignsCollection of Rewards detail - per Campaign basis
~ campaignIdUnique ID of a campaign, generated by AppVirality
~ campaignNameCampaign Name, given in AppVirality dashboard
~ rewardUnitReward Unit

Status codes which you will see while using Getuserbalance API

Status codes and description for API responses

Status CodeDescription
0No data found for the search criteria
1Success
2Invalid User Key
3Invalid GrowthHack
4Invalid CampaignID
5Invalid StoreID or EmailID