Events

Gameball API Events endpoint allows you to record your users' actions in order to track their journey into our Widget.

Events help you record any actions your user performs, along with any metadata that describe the action. For further elaboration on events check Understand your players' events.

The Events API call is used to record any actions your users perform, along with any properties or metadata that describe the action.

Each action is known as an event. Each event has a name, like place_order, and metadata, for example a place_order event might have properties like amount or source. Calling events is one of the first steps to getting started with Gameball.

The Events API call accepts a collection of event to help tracking multiple user actions. Event object is described in Object Reference.

Events

POST /integrations/event

The API call is used to send an event to Gameball where the received event will be evaluated and counted toward player challenges

Headers

NameTypeDescription

APIKey

string

client API Key

Request Body

NameTypeDescription

events

object

Collection of events to be triggered by Gameballs's engine.

playerUniqueId

string

Player unique Id used by integrator to uniquely identify the player in Gameball

playerAttributes

object

player attributes used to create\update the Player with unique Id in Gameball. Player object is described in Object Reference section.

{
  "response": {},
  "Success": true,
  "ErrorMsg": "string",
  "ErrorCode": 0
}

Examples

Example One: The below represents events done by a user with playerUniqueId “player123” on two events:

  1. Event “Buy”: (An event that has 2 metadata keys)

    1. Amount: Total money paid by the user

    2. Type: Type of products being bought by user

  2. Event Review: (An event with no metadata)

{
  "events": {
    "Buy": {    // Events with metadata
      "Amount": "100",
      "Type": "Electronics"
    },
    "Review": { } // For events with no metadata
  },
  "playerUniqueId": "player123"
}

Example Two: The below example shows how playerAttributes object can be supplemented to this request to create or update user data, while triggering an event:

  1. Event Reserve: An event with one metadata key

    1. Rooms: Types of rooms booked by user, 1 for standard and 2 for deluxe rooms

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.

{
  "events": {
    "Reserve": {
        "Rooms": 2
                }
  },
  "playerUniqueId": "string",
  "playerAttributes": {
    "displayName": "string",
    "email": "string",
    "mobileNumber": "string",
    "gender": "string",
    "dateOfBirth": "2019-09-19T21:06:29.158Z",
    "joinDate": "2019-09-19T21:06:29.158Z"
  }
}

Remarks

  • Consumer can provide any number of events given that each event name is not replicated

  • Consumer can provide from 0 to all event metadata keys, however the keys must not be replicated. If the consumer has multiple values for a single metadata key it should be provide as an array of strings as follows “key”: [“value1”, “value2”, “value3”, …]

Last updated