Skip to content

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/saas/v1_0/getuserbalanceapplication/json

Input i.e. Request

{
"apikey":"7ffdda00fd5c4338a9c1a44e00663648",
"privatekey":"d1e881dc60fa4856be34a44f00d96c9a",
"userkey":"176502556c624614b913a62400ab4d7e",
"email":"user@mail.com",
"useraccountid":"34",
"campaignid":"1234",
"growthhack": "SaaS_Referrals"
}

Input Params

Input ParamsDescription
apikeyAPI Key of the Product
Get it from DashboardApp Details
privatekeyPrivate key for API requests
Get it from: DashboardApp Details › Click App SettingsAdvanced
userkeyUser Key of the Product user, assigned by AppVirality - a unique identifier for every Product user recorded
email
(optional)
Email of the user
useraccountid
(optional)
ID of the user in your Account(helps to identify users on dashboard as you do in your product)
campaignidUnique ID of a campaign
growthHack
(optional)
Type of Growth Hack (helps you filter rewards)
values: SaaS_Referrals

Response

{
"userbalance": [
{
"rewardunit": "% Discount",
"total": 60, // Total earnings of user
"claimed": 50, // Amount marked rewarded to the user
"pending": 10, // Yet to be rewarded
"approved": 0, // Available to redeem
"growthhacks": [
{
"growthhack": "SaaS_Referrals", // growth hack name
"rewardunit": "% Discount",
"total": 60, // Total earnings of user - for this growth hack
"claimed": 50, // Amount marked rewarded to the user - for this growth hack
"pending": 10, // Yet to be rewarded - for this growth hack
"approved": 0, // Available to redeem - for this growth hack
"campaigns": [
{
"campaignid": 1234,
"campaignname": "SaaS Referrals",
"growthhack": "SaaS_Referrals",
"rewardunit": "% Discount",
"total": 60, // Total earnings of user - for this campaign
"claimed": 50, // Amount marked rewarded to the user - for this campaign
"pending": 10 // Yet to be rewarded - for this campaign
"approved": 0, // Available to redeem - for this campaign
}
]
}
]
}
],
"success": true,
"message": null
}

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)
userbalanceReward detail
~ totalTotal Earnings of the user
~ claimedAmount marked as rewarded
~ pendingAmount yet to be rewarded
~ approvedAmount available to redeem
~ 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