Action
The Actions API endpoint is used to send player event(s), completing cashback and redeeming points in a single API call.

POST - Send Action

1
https://api.gameball.co/api/v3.0/integrations/action
Copied!
This API call is used to perform the following actions as follows: (optionally) redeem points, reward points and performing an event or a set of events by a player.
The endpoint is flexible and can be used to send single or all of the mentioned actions to Gameball in the same request.

Request

Attribute
Type
Required
Description
APIKey
string
Yes
Client APIKey

Body

Parameter
Type
Required
Description
playerUniqueId
string
Yes
Unique identifier for the player at Gameball
actionId
string
No
Unique action ID which identifies the underlying action in your system, e.g. flight number, invoice number. It will be used for reversing any reward or redemption transaction on Gameball.
rewardAmount
number
No
Monetary value that the player will be rewarded for based on the Cashback program configurations.
(Note: Amount must be positive).
events
object
No
Collection of player events with their metadata to be sent to Gameball. (Learn more about events in the help center.)
Example:
{
"review": {},
"reserve": {
"rooms": 2
}
}
actionDate
string
No
The date this action was performed, as an ISO8601 timestamp. Defaults to now if not provided.
Example:"2019-09-21T16:53:28.190Z"
holdReference
string
No
Hold reference ID received after calling Hold Points API. This is used in case you want to use already held points. In such case, redeemedAmount should be null
redeemedAmount
number
No
Monetary value of the redeemed points to be used by that player while placing his order. If this field is set, then the holdReference value should be null.
In case the player doesn't exist on Gameball before sending the Actions API call, the player will be created automatically on Gameball.

Sample Request Body

1
{
2
"playerUniqueId": "player123",
3
"actionId": "act_123456789",
4
"events": {
5
"review": {},
6
"reserve": {
7
"rooms": 2
8
}
9
},
10
"actionDate":"2019-09-19T16:14:09.895Z",
11
"rewardAmount": 99.98,
12
"holdReference": "2342452352435234",
13
"redeemedAmount": null,
14
}
Copied!

Response

Parameters
Type
Description
playerUniqueId
string
Unique Identifier for a player at Gameball.
gameballRedeemTransactionId
string
Redeem Transaction ID on Gameball system.
(Note: Result is null if neither holdReference nor redeemedAmount was provided in the request body).
gameballRewardTransactionId
string
Reward Transaction ID on Gameball system.
(Note: Result is null if rewardAmount was not provided in the request body).
rewardedPoints
integer
Points awarded to the player (if any). This is based on your Cashback configuration.

Sample Response

1
{
2
"playerUniqueId": "player123",
3
"gameballRedeemTransactionId": "12345",
4
"gameballRewardTransactionId": "12346",
5
"rewardedPoints": 50
6
}
Copied!

Usage Examples

Example One

The example shown is a request sent to Gameball to send events by adding the eventsparameter
cURL
1
curl -X POST -H 'apiKey: 807b041b7d35425988e354e1f6bce186' -d '{
2
"playerUniqueId":"player123",
3
"events":{
4
"review":{},
5
"reserve":{
6
"rooms":2
7
}
8
},
9
"actionId": "tra_123456789",
10
"actionDate":"2019-09-19T16:14:09.895Z",
11
}' -v -i 'https://api.gameball.co/api/v3.0/integrations/action'
Copied!

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 reward the player by adding the rewardAmount in the the request.
cURL
1
curl -X POST -H 'apiKey: 807b041b7d35425988e354e1f6bce186' -d '{
2
"playerUniqueId": "player123",
3
"events": {
4
"review": {},
5
"reserve": {
6
"rooms": 2
7
}
8
},
9
"rewardAmount": 99.98,
10
"actionId": "tra_123456789",
11
"actionDate":"2019-09-19T16:14:09.895Z",
12
}' -v -i 'https://api.gameball.co/api/v3.0/integrations/action'
Copied!

Example Three

The example shown is a request sent to Gameball to send 3 actions , the actions are sending events through the events parameter, rewarding the player by adding the rewardAmount in the request payload and lastly redeeming points by adding the holdReference in the request payload.
cURL
1
curl -X POST -H 'apiKey: 807b041b7d35425988e354e1f6bce186' -d '{
2
"playerUniqueId": "player123",
3
"events": {
4
"review": {},
5
"reserve": {
6
"rooms": 2
7
}
8
},
9
"rewardAmount": 99.98,
10
"actionId": "tra_123456789",
11
"actionDate":"2019-09-19T16:14:09.895Z",
12
"holdReference": "2342452352435234",
13
}' -v -i 'https://api.gameball.co/api/v3.0/integrations/action'
Copied!
Last modified 1mo ago