Player

The player API is responsible for creating players or updating exisitng player informati

Player

POST /integrations/player

The API call is used to create or update a player details in Gameball with the provided attributes

Headers

NameTypeDescription

APIKey

string

Client API key

Request Body

NameTypeDescription

levelOrder

integer

An integer representing the logical order of the configured level. IMPORTANT: manual player leveling is available under special circumstances and is not available by default. Contact us for more info.

playerAttributes

object

An object containing all of the attributes of the player. Player object is described in Object Reference section.

playerUniqueId

string

Player unique identifier used to uniquely identify the player on Gameball.

{
    "gameballId": 4067
}

Response Description

Attribute

Description

gameballId

Player ID on Gameball

Choose an Unchangeable Player Unique ID

Gameball user profile gets created using the playerUniqueId. It is highly recommended to have the unique ID as an identifier that would NEVER be changed. If this unique ID changes for a given player, you risk losing all original data for that player and hence losing their points and rewards on Gameball. Accordingly, it is NOT recommended to use email address or mobile number as the unique ID as both can be changed by the user at anytime.

Usage Example

The example shown is a request sent to Gameball to create a player with playerUniqueIdplayer123and with some custom attributes inside the custom Object.

All attributes should be inside the playerAttributes object, if the values of any attributes shown below are unavailable, remove the attribute from the playerAttributes object.

Navigate through different tabs to view the APIs for each language.

curl -X POST -H 'apiKey: 807b041b7d35425988e354e1f6bce186' -d '{
  "playerUniqueId":"player123",
   "playerAttributes":{
      "displayName":"Jon Snow",
      "firstName": "Jon",
      "lastName": "Snow",
      "email":"jon.snow@example.com",
      "gender":"M",
      "dateOfBirth":"1980-09-19T00:00:00.000Z",
      "joinDate":"2019-09-19T21:06:29.158Z",
  	"custom":{
         "location":"Miami",
         "graduationDate":"2018-07-04T21:06:29.158Z",
         "isMarried":false
      }
  	}

  }' -v -i 'https://api.gameball.co/api/v2.0/integrations/player'

Player Info

POST /integrations/player/info

The API call is used to retrieve player's info.

Headers

NameTypeDescription

Lang

string

Preferred language to get your player's info in.

APIKey

string

Client API Key

Request Body

NameTypeDescription

playerUniqueId

string

Player unique identifier used to uniquely identify the player on Gameball.

hash

string

Hashed body with SHA1 algorithm. As described in Hashing Transaction Messages section. Note: hash is automatically handled when using server-side SDKs.

{
    "displayName": "Jon Snow",
    "referralCode": "CODE12",
    "referralLink": "https://gameofthrones.myshopify.com/account/register?ReferralCode=CODE12",
    "score": {
        "scoreBalance": 15830,
        "scoreName": "Score"
    },
    "level": {
        "name": "Gold",
        "description": null,
        "levelStartScore": 7500,
        "levelOrder": 4,
        "iconPath": "https://cdn.gameball.co/uploads/Client 1/2cf4b388-f957-4789-8309-5476907c1baeicon-level-gold@2x.png",
        "benefits": {
            "scoreEnteryReward": 0,
            "pointsEnteryReward": 0,
            "levelDiscount": null,
            "discountCapping": null
        }
    },
    "points": {
        "pointsBalance": 46012,
        "pointsValue": 460.12,
        "currency": "EGP",
        "pointsName": "Points"
    },
    "playerAttributes": [
        {
            "name": "Email",
            "value": "jon.snow@example.com",
            "type": "String"
        },
        {
            "name": "MobileNumber",
            "value": "0123456789",
            "type": "String"
        },
        {
            "name": "Gender",
            "value": "M",
            "type": "String"
        },
        {
            "name": "DateOfBirth",
            "value": "09/19/1980 00:00:00",
            "type": "Date"
        },
        {
            "name": "JoinDate",
            "value": "09/19/2019 21:06:29",
            "type": "Date"
        }
    ]
}

Response Description

Attribute

Description

displayName

Player's Display Name

referralCode

Referral Code

referralLink

Referral URL

score

Score object used to describe the player's score at Gameball. Score Object is described in Object Reference section.

level

Level object used to describe the player's current level at Gameball. Level Object is described in Object Reference section.

points

Points object used to describe the player's points at Gameball. Points Object is described in Object Reference section.

playerAttributes

An object containing all of the attributes of the player. Player Object is described in Object Reference section.

Examples

The example shown is a request sent to Gameball to get a player info with playerUniqueIdplayer456and with the hash.

curl -X POST -H 'apiKey: 807b041b7d35425988e354e1f6bce186' -d '{
   "playerUniqueId":"player456",
   "hash":"7090689dc127ddfbe4a7c2260060afe5e6fc3264g"
  }' -v -i 'https://api.gameball.co/api/v2.0/integrations/player/info'

Attach Tags

POST /integrations/player/tags

Used to attach tags to a Player

Headers

NameTypeDescription

APIKey

string

Client API Key

Request Body

NameTypeDescription

playerUniqueId

string

Player unique identifier used to uniquely identify the player on Gameball

tags

string

Comma separated string of tags to be attached to the player

Detach Tags

DELETE /integrations/player/tags

Used to detach tags from Player

Headers

NameTypeDescription

APIKey

string

Client API Key

Request Body

NameTypeDescription

playerUniqueId

string

Player unique identifier used to uniquely identify the player on Gameball

tags

string

Comma separated string of tags to be detached from the player

Last updated