Actions

Actions are used to send player event, completing purchase reward and redeeming points in a single API call

Actions endpoint can be used to complete the below:

The endpoint is flexible and can be used to send single or all of the mentioned information to Gameball in the same request.

The following APIs use Hashing Function SHA1, Check how Hashing is done below.

Send Action

POST /integrations/action

Headers

NameTypeDescription

APIKey

string

Client API Key

Request Body

NameTypeDescription

pointsTransaction

object

pointsTransaction object is described in Object Reference section

events

object

Collection of player events to be sent to Gameball.

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.

{
    "redeemResponse": {
        "playerUniqueId": "player123",
        "playerAttributes": null,
        "gameballTransactionId": 12345,
        "transactionId":"tra_123456789",
        "holdReference":"2342452352435234",
        "transactionTime":"2019-09-19T16:14:09.895Z"
    },
    "rewardResponse": {
        "playerUniqueId": "player123",
        "playerAttributes": null,
        "gameballTransactionId": 12346,
        "amount": "50.0",
        "transactionId": "tra_123456780",
        "transactionTime":"2019-09-19T16:14:09.895Z"
    },
    "eventResponse": {}
}

Response Description

Response Parameters

Description

redeemResponse

Refer to Redeem

rewardResponse

Refer to Reward

eventResponse

Refer to Events

In case the player doesn't exist on Gameball before sending the Actions API call, the player will be created automatically on Gameball.

Usage Examples

Example One

The example shown is a request sent to Gameball to send events by adding the eventsparameter

curl -X POST -H 'apiKey: 807b041b7d35425988e354e1f6bce186' -d '{
   "playerUniqueId":"player123",
   "events":{
      "review":{},
      "reserve":{
         "rooms":2
      }
   }
  }' -v -i 'https://api.gameball.co/api/v2.0/integrations/action'

Example Two

The example shown is a request sent to Gameball to send multiple actions, in the following example the endpoint is used to send events and a purchase reward by adding the rewardAmount in the pointsTransaction object

curl -X POST -H 'apiKey: 807b041b7d35425988e354e1f6bce186' -d '{
    "playerUniqueId": "player123",
    "events": {
        "review": {},
        "reserve": {
            "rooms": 2
        }
    },
    "pointsTransaction": {
        "rewardAmount": 99.98,
        "transactionId": "tra_123456789",
        "transactionTime":"2019-09-19T16:14:09.895Z",
        "hash":"f3437e2919ab9f853c7ccde92f4f2b9a6def42db"
    }
  }' -v -i 'https://api.gameball.co/api/v2.0/integrations/action'

Example Three

The example shown is a request sent to Gameball to send 3 actions , the actions are sending events through the events parameter, sending a purchase reward by adding the rewardAmount in the pointsTransaction object and lastly redeeming points by adding the holdReference in the pointsTransaction object

curl -X POST -H 'apiKey: 807b041b7d35425988e354e1f6bce186' -d '{
    "playerUniqueId": "player123",
    "events": {
        "review": {},
        "reserve": {
            "rooms": 2
        }
    },
    "pointsTransaction": {
        "rewardAmount": 99.98,
        "holdReference": "2342452352435234",
        "transactionId": "tra_123456789",
        "transactionTime":"2019-09-19T16:14:09.895Z",
        "hash":"f3437e2919ab9f853c7ccde92f4f2b9a6def42db"
    }
  }' -v -i 'https://api.gameball.co/api/v2.0/integrations/action'

Last updated