Gameball.holdPoints(HoldPointsRequest, callback)//holds a specific amount of points from the player’s points balance.
Gameball.reverseHold(ReverseHoldRequest, callback)//cancels previously held points identified by the given hold reference.
Gameball.reverseTransaction(ReverseTransaction, callback)//cancels a purchase reward or refund a points redemption transactions in Gameball.
Gameball.redeemPoints(RedeemPointsRequest, callback)//enables the player to use Gameball points as a payment method since it can be substituted for monetary values.
Gameball.rewardPoints(RewardPointsRequest, callback)//rewards a player with points equivalent to the given amount.
Examples
Creating a Player
Gameball.initializePlayer({
"playerUniqueId":"player123",
"playerAttributes":{
"displayName":" Jon Snow",
"email":"jon.snow@example.com",
"dateOfBirth":"1980-09-19T00:00:00.000Z",
"custom":{
"isGraduated":false,
"location":"Egypt, Cairo"
}
},
function(err,res){
if(err)console.log(err)
elseconsole.log(res)
})
Getting a Player's Information
Gameball.getPlayerInfo({
"playerUniqueId":"1597247015986"
},
function(err,res){
if(err)console.log(err)
elseconsole.log(res)
})
Sending an Event
Gameball.sendEvent({
"events":{
"reserve":{
"rooms":2
}
},
"playerUniqueId":"player123",
"playerAttributes":{
"displayName":"Jon Snow",
"email":"jon.snow@example.com",
"dateOfBirth":"1980-09-19T00:00:00.000Z",
"joinDate":"2019-09-19T21:06:29.158Z"
}
},
function(err,res){
if(err)console.log(err)
elseconsole.log(res)
})
Gameball.sendEvent({
"events":{
"place_order":{
"total_amount":"100",
"category":[
"electronics",
"cosmetics"
]
},
"review":{}
},
"playerUniqueId":"1596487841748"
},
function(err,res){
if(err)console.log(err)
elseconsole.log(res)
})
Sending an Action
//Action being Sent: an Event.
Gameball.sendAction({
"playerUniqueId":"your_player_unique_id",
"events":{
"review":{},
"reserve":{
"rooms":2
}
}
},
function(err,res){
if(err)console.log(err)
elseconsole.log(res)
})
//Action being Sent: an Event and a Reward Transaction.
Gameball.sendAction({
"playerUniqueId":"your_player_unique_id",
"events":{
"review":{},
"reserve":{
"rooms":2
}
},
"pointsTransaction":{
"rewardAmount":2
}
},
function(err,res){
if(err)console.log(err)
elseconsole.log(res)
})
//Action being Sent: an Event and a Redeem Transaction.
Unsuccessful requests raise exceptions. The raised exception will reflect the sort of error that occurred with appropriate message and error code . Please refer to the Gameball API docs.
Contact
For usage questions\suggestions drop us an email at support[ at ]gameball.co. Please report any bugs as issues.