Player
The Player API can be used to create, update and display players' information as well as attach/detach tags in Gameball. Players are uniquely identified by playerUniqueId.

Available Endpoints

Type
Description
Endpoint
POST
​Create Player​
/integrations/player
GET
​Retrieve Player​
/integrations/player/{playerUniqueId}
GET
/integrations/player/{playerUniqueId}/balance
GET
/integrations/player/{playerUniqueId}/progress
POST
​Attach Tags​
/integrations/player/tags
DELETE
​Detach Tags​
/integrations/player/tags

POST - Create Player

1
https://api.gameball.co/api/v3.0/integrations/player
Copied!
The API call is used to create or update a player in Gameball with the provided attributes.
This endpoint could also be used in case of referral. In such case,referralCode of the referring player is to be provided along with the body parameters. So that Gameball understands that the newly created player is being referred.

Request

Attribute
Type
Required
Description
APIKey
string
Yes
Client API key

Body

Attribute
Type
Required
Description
playerUniqueId
string
Yes
Unique identifier for the player in your database.
Could be database ID, random string, email or anything that uniquely identifies the player.
playerAttributes
object
No
An object with set of properties that you want to set for the player.
referrerCode
string
No
Referring player’s referral code. This is used in case of referral, where the player to be created is referred by the player having this code.
levelOrder
integer
No
The level order to place the player in.
IMPORTANT: manual player leveling is available under special circumstances and is not available by default. Contact us for more info.

playerAttributes Object

Parameter
Type
Description
displayName
string
Player's display name
firstName
string
Player's first name
lastName
string
Player's last name
gender
string
Player's gender. Example: M or F, Male or Female.
email
string
Player's email
dateOfBirth
string
Player's date of birth
Example: "1980-09-19T00:00:00.000Z"
joinDate
string
Player join date at your system.
Example: "2019-09-19T21:06:29.158Z"
tags
string
Comma separated string of tags to be attached to the player.
Example: "VIP,Platinum"
community
string
Describe which community a player belongs to.
Example: ?
custom
object
Key value pairs of any extra player attributes.
{"class" : "E2022", "weight" : 78}
1
{
2
"playerUniqueId":"player123",
3
"playerAttributes":{
4
"displayName":"Jon Snow",
5
"firstName": "Jon",
6
"lastName": "Snow",
7
"email":"[email protected]",
8
"gender":"M",
9
"dateOfBirth":"1980-09-19T00:00:00.000Z",
10
"joinDate":"2019-09-19T21:06:29.158Z",
11
"tags": "VIP,Platinum",
12
"custom":{
13
"location":"Miami",
14
"graduationDate":"2018-07-04T21:06:29.158Z",
15
"isMarried":false
16
}
17
},
18
"referrerCode": null,
19
"levelOrder": null,
20
}
Copied!

Response

Parameter
Type
Description
gameballId
string
Player's ID at Gameball
Sample Response
1
{
2
"gameballId": "4067"
3
}
Copied!

Usage Examples

Example One

This example creates a new player at Gameball, using playerUniqueId, playerAttributes with custom attributes.
cURL
1
curl -X POST -H 'apiKey: 807b041b7d35425988e354e1f6bce186' -d '{
2
"playerUniqueId":"player123",
3
"playerAttributes":{
4
"displayName":"Jon Snow",
5
"firstName": "Jon",
6
"lastName": "Snow",
7
"email":"[email protected]",
8
"gender":"M",
9
"dateOfBirth":"1980-09-19T00:00:00.000Z",
10
"joinDate":"2019-09-19T21:06:29.158Z",
11
"custom":{
12
"location":"Miami",
13
"graduationDate":"2018-07-04T21:06:29.158Z",
14
"isMarried":false
15
}
16
}
17
​
18
}' -v -i 'https://api.gameball.co/api/v3.0/integrations/player'
Copied!

Example Two

This example is a request sent to Gameball when player with referralCodeβ€œCODE11” successfully refers a new player with playerUniqueId β€œplayer456”. Player attributes are also sent within the same request.β€Œ
Note: All attributes inside the playerAttributes object are optional, if the values of any attributes shown below are unavailable, remove the attribute from the playerAttributes object.
cURL
1
curl -X POST -H 'apiKey: 807b041b7d35425988e354e1f6bce186' -d '{
2
"referrerCode":"CODE11",
3
"playerUniqueId":"player456",
4
"playerAttributes":{
5
"displayName":" Tyrion Lannister",
6
"firstName":"Tyrion",
7
"lastName":"Lannister",
8
"email":"[email protected]",
9
"gender":"M",
10
"dateOfBirth":"1978-01-11T00:00:00.000Z",
11
"joinDate":"2019-09-19T21:06:29.158Z",
12
"custom":{
13
"location":"Miami",
14
"graduationDate":"2018-07-04T21:06:29.158Z",
15
"isMarried":false
16
}
17
}
18
}' -v -i 'https://api.gameball.co/api/v3.0/integrations/player'
Copied!

GET - Retrieve Player

This API call is used to retrieve player's information.
1
https://api.gameball.co/api/v3.0/integrations/player/{playerUniqueId}
Copied!

Request

Header

Attribute
Type
Required
Description
APIKey
string
Yes
Client APIKey
Lang
string
No
Language to get the player info with. If not provided, the response would be in default language.
Note: The language provided should be as per configured languages in your account.
Example: "en", "fr".

Path Parameters

Parameter
Type
Required
Description
playerUniqueId
string
Yes
Unique identifier for the player at Gameball

Response

Parameter
Type
Description
playerUniqueId
string
Unique identifier for the player at Gameball
playerAttributes
object
An object with set of player properties defined previously at the player's creation.
referralCode
string
Player's Referral Code. Used to refer another player.
referralLink
string
Referral URL.
dynamicReferralLink
string
Referral URL for mobile APPs integrations with firebase
level
object
Level object holds information about the player's current level at Gameball.

level Object

The level object contains info about the player's current level.
Parameter
Type
Description
name
string
Level Name
description
string
Level Description
levelOrder
integer
Level Order
iconPath
string
Logo icon of the level.
benefits
object
An object contains the benefits of the current level of the specified player.
The benefits object is described as follows:
    scoreEntryReward: Rewarded score on entering the current level.
    pointsEntryReward: Rewarded points on entering the current level.
    levelDiscount: Discount rewarded to the player on entering the current level.
    discountCapping: Maximum order total price that allows the discount to be applied.

Sample Response

1
{
2
"playerUniqueId":"player456",
3
"playerAttributes":{
4
"displayName":"Jon Snow",
5
"email":"[email protected]",
6
"mobileNumber":"0123456789",
7
"gender":"M",
8
"joinDate":"09/19/2019 21:06:29",
9
"tags":[
10
"VIP",
11
"Elite"
12
],
13
"custom":{
14
"location":"Miami",
15
"graduationDate":"2018-07-04T21:06:29.158Z",
16
"isMarried":false
17
}
18
},
19
"referralCode":"CODE12",
20
"referralLink":"https://gameofthrones.myshopify.com/account/register?ReferralCode=CODE12",
21
"dynamicReferralLink":"https://gameofthrones.myshopify.com/account/register?ReferralCode=CODE12",
22
"level":{
23
"name":"Gold",
24
"description":null,
25
"levelOrder":4,
26
"iconPath":"https://cdn.gameball.co/uploads/Client 1/[email protected]",
27
"benefits":{
28
"scoreEntryReward":0,
29
"pointsEntryReward":0,
30
"levelDiscount":null,
31
"discountCapping":null
32
}
33
}
34
}
Copied!

Usage Example

The example shown is a request sent to Gameball to get a player info with playerUniqueIdβ€œplayer456”.
cURL
1
curl -X GET -H 'apiKey: 807b041b7d35425988e354e1f6bce186'
2
-v -i 'https://api.gameball.co/api/v3.0/integrations/player/player456'
Copied!

GET - Player's Balance

This API call is used to retrieve player's current points balance available for redemption and the corresponding equivalent amount.
1
https://api.gameball.co/api/v3.0/integrations/player/{playerUniqueId}/balance
Copied!

Request

Header

Attribute
Type
Required
Description
APIKey
string
Yes
Client APIKey
secretKey
string
Yes
Client Secret Key

Path Parameters

Parameter
Type
Required
Description
playerUniqueId
string
Yes
Unique identifier for the player at Gameball

Response

Parameter
Type
Description
pointsBalance
integer
Player current points balance.
pointsValue
number
The player's equivalent monetary value topointsBalance according to your Cashback program configurations.
pendingPoints
integer
Player current pending points (Not active yet, therefore cannot be used at this moment)
pendingPointsValue
number
The player's equivalent monetary value to pendingPoints according to your Cashback program configurations.
currency
string
Store currency.
pointsName
string
The naming of the rewarding points that appears to the player.

Sample Response

1
{
2
"pointsBalance": 11500,
3
"pointsValue": 115,
4
"pendingPoints": 200,
5
"pendingPointsValue": 2,
6
"currency": "USD",
7
"pointsName": "Points"
8
}
Copied!

Usage Example

The example shown is a request sent to Gameball to get a player's balance with his playerUniqueId
cURL
1
curl -X GET -H 'apiKey: 807b041b7d35425988e354e1f6bce186' \
2
-H 'secretKey: klmb041b7d354259l3u4ft35e1q2r3703' -d
3
-v -i 'https://api.gameball.co/api/v3.0/integrations/player/player456/balance'
Copied!

GET - Player's Progress πŸ‘‘

1
https://api.gameball.co/api/v3.0/integrations/player/{playerUniqueId}/progress
Copied!
This API call is used to show the overall player's progress in the available challenges, referral program and levels across Gameball programs.
This endpoint is only available for our GURU customers only πŸ‘‘

Request

Header

Attribute
Type
Required
Description
APIKey
string
Yes
Client APIKey
secretKey
string
Yes
Client Secret Key

Path Parameters

Parameter
Type
Required
Description
playerUniqueId
string
Yes
Unique identifier for the player at Gameball

Response

Parameter
Type
Description
playerUniqueId
string
Unique identifier for the player at Gameball
referralCode
string
Player's referral code.
referralLink
string
Player's referral link.
dynamicReferralLink
string
Referral URL for mobile APPs integrations with firebase
playerAttributes
object
An object with set of player properties.
levelsProgress
object
An object contains the level information of the current and the next level (empty if the player is on top level already) of the specified player.
The level object is described as follows:
    order: Level order.
    name: Level name.
    minProgress: Minimum score to be in that level.
    icon: The icon URL describing the level.
challengesProgress
array
An array of challenge objects where each describe an available challenge for the player and his progress in each.
totalReferredPlayers
integer
The total number of the player's referred players.
points
object
An object that describes the player's current balance.

points Object

The points object contains info about the player's points.
Parameter
Type
Description
pointsBalance
integer
Player current points balance.
pointsValue
number
The player's equivalent monetary value topointsBalance according to your Cashback program configurations.
pendingPoints
integer
Player current pending points (Not active yet, therefore cannot be used at this moment)
pendingPointsValue
number
The player's equivalent monetary value to pendingPoints according to your Cashback program configurations.
currency
string
Your system currency as configured at Gameball.
pointsName
string
The naming of the rewarding points that appears to the player.

challenge Object

The challenge object shows description of the challenge as follows.
Parameter
Type
Description
id
string
Unique Identifier for the challenge.
name
string
Challenge Name
isUnlocked
boolean
Indicates whether the challenge is unlocked for this player or not.
highScoreAmount
integer
Indicates the player's High Score. Note: This field is provided in case the challenge is a High Score Challenge.
completionPercentage
number
Shows the player's current progress towards achieving the challenge.
achievedCount
integer
The number of times this challenge has been achieved by the player.
isRepeatable
boolean
Indicates whether the challenge is repeatable or not.
icon
string
The challenge's icon URL path.

Sample Response

1
{
2
"playerUniqueId":"player456",
3
"referralCode":"CODE12",
4
"referralLink":"https://gameofthrones.myshopify.com/account/register?ReferralCode=CODE12",
5
"dynamicReferralLink":"https://gameofthrones.myshopify.com/account/register?ReferralCode=CODE12",
6
"playerAttributes":{
7
"dateOfBirth":null,
8
"communityId":null,
9
"tags":[
10
"VIP"
11
]
12
},
13
"levelsProgress":{
14
"current":{
15
"order":1,
16
"name":"level 1",
17
"minProgress":0,
18
"icon":"https://cdn.gameball.co/uploads/client776/ad8b2587-959f-48fd-ab58-a643323652begb.png"
19
},
20
"next":{
21
"order":2,
22
"name":"level 2",
23
"minProgress":2000,
24
"icon":"https://cdn.gameball.co/uploads/client776/ad8b2587-959f-48fd-ab58-a643323652begb.png"
25
}
26
},
27
"challengesProgress":[
28
{
29
"id":"123",
30
"name":"Welcome",
31
"isUnlocked":true,
32
"highScoreAmount":null,
33
"completionPercentage":0,
34
"isRepeatable":false,
35
"achievedCount":0,
36
"icon":"https://cdn.gameball.co/uploads/client776/ad8b2587-959f-48fd-ab58-a643323652begb.png"
37
},
38
{
39
"id":"p123",
40
"name":"Place Order",
41
"isUnlocked":true,
42
"highScoreAmount":null,
43
"completionPercentage":55,
44
"isRepeatable":true,
45
"achievedCount":2,
46
"icon":"https://cdn.gameball.co/uploads/client776/ad8b2587-959f-48fd-ab58-a643323652begb.png"
47
}
48
],
49
"totalReferredPlayers":0,
50
"points":{
51
"pointsBalance":11500,
52
"pointsValue":115,
53
"pendingPoints": 200,
54
"pendingPointsValue": 2,
55
"currency":"USD",
56
"pointsName":"Points"
57
}
58
}
Copied!

Usage Example

The example shown is a request sent to Gameball to get a player's progress with playerUniqueIdβ€œplayer456”.
cURL
1
curl -X POST -H 'apiKey: 807b041b7d35425988e354e1f6bce186'
2
-v -i 'https://api.gameball.co/api/v3.0/integrations/player/player456/progress'
Copied!

POST - Attach Tags to Player

This API is used to attach tags to a Player.
1
https://api.gameball.co/api/v3.0/integrations/player/{playerUniqueId}/tags
Copied!

Request

Header

Attribute
Type
Required
Description
APIKey
string
Yes
Client API key

Path Parameters

Attribute
Type
Required
Description
Attribute
Type
Required
Description
playerUniqueId
string
Yes
Unique identifier for the player at Gameball.

Body

Attribute
Type
Required
Description
tags
string
Yes
Comma separated string of tags to be attached to the player.

Sample Body

1
{
2
"playerUniqueId":"player456",
3
"tags":"VIP,Platinum"
4
}
Copied!

Usage Example

The example shown is a request sent to Gameball to attach tags "VIP,Platinum" to a player with playerUniqueIdβ€œplayer456”.
cURL
1
curl -X POST -H 'apiKey: 807b041b7d35425988e354e1f6bce186' -d '{
2
"playerUniqueId":"player456",
3
"tags":"VIP,Platinum"
4
}' -v -i 'https://api.gameball.co/api/v3.0/integrations/player/tags'
Copied!

DELETE - Detach Tags

1
https://api.gameball.co/api/v3.0/integrations/player/{playerUniq/tags
Copied!
This API is used to detach tags from a Player.

Request

Header

Attribute
Type
Required
Description
APIKey
string
Yes
Client API key

Path Parameters

Attribute
Type
Required
Description
Attribute
Type
Required
Description
playerUniqueId
string
Yes
Unique identifier for the player at Gameball.

Body

Attribute
Type
Required
Description
playerUniqueId
string
Yes
Unique identifier for the player at Gameball.
tags
string
Yes
Comma separated string of tags to be attached to the player.

Sample Body

1
{
2
"playerUniqueId":"player456",
3
"tags":"VIP"
4
}
Copied!

Usage Example

The example shown is a request sent to Gameball to detach tags "VIP" from a player with playerUniqueIdβ€œplayer456”.
cURL
1
curl -X DELETE -H 'apiKey: 807b041b7d35425988e354e1f6bce186' -d '{
2
"playerUniqueId":"player456",
3
"tags":"VIP"
4
}' -v -i 'https://api.gameball.co/api/v3.0/integrations/player/tags'
Copied!
Last modified 10d ago