Game Event API

API

API Intro
Game Event API
Player API
Device API

Wrappers

Corona API Wrapper
Unity API Wrapper

The Game Event API records your in-game events. You can link these game events to a session, a player and a device (ideally, all three). Don't forget to URL encode the strings you submit. You may add as many custom parametes as you like that will be added as properties for your event. The wrapper we created for Unity automatically queues events and sends them based upon either event based or time based triggers.

PLEASE NOTE: you must provide either a player identifier, a machine identifer or both. If only one is submitted, we will use the one identifier submitted for both.


Game Event API Parameters

Parameter Required? Datatype Description
gh_api_key yes char(256) The unique GAME_API_KEY of your game
gh_name yes char(256) The name of the event. For example, "Level Started".
gh_player_identifier either char(256) A string that uniquely identifies a player. This is typically used if you require a login for your game. This allows game events to to be linked to their unique players. If this is not provided, you must include a device identifier.
gh_device_identifier either char(256) A string that uniquely identifies a device. For example, a GUID or UUID. This allows game events to to be linked to their unique devices. If this is not provided, you must include a player identifier.
gh_session_identifier no char(256) A string that uniquely identifies a game session. For example, a GUID or UUID. This allows game events to to be linked to their unique sessions.
gh_submitted_at no char(256) The DateTime when you submit the event to our service. If you do not send both submitted_at and recorded_at, the event will be recorded when it is received by our server.
In the format of: 2012-01-01T08:03:19.0000000-04:00.
In .NET, System.DateTime.Now.ToString("O").
gh_recorded_at no char(256) The DateTime when the event occurred. If you do not send both submitted_at and recorded_at, the event will be recorded when it is received by our server.
In the format of: 2012-01-01T08:03:19.0000000-04:00.
In .NET, System.DateTime.Now.ToString("O").
gh_bucket no text A large text field used for storing large amounts of text or unstructured data. For example, we use it to store stack traces from Unity.
YOUR_CUSTOM no char(256) You can include as many additional custom parameters as you need. These will be stored as properties to the event. Be sure to limit both the parameter name and value to char(256). We suggest at least sending version and level information. You can also send multiple values for a parameter as an array with the format [value1,value2,value3].



POST api/v2/events - Logs new game events
On Success - returns HTTP status 200 and '0 - Success' in the response text body.
On Failure - returns an appropriate HTTP status code and an error message in the response text body.


Example

curl -d "
gh_api_key=0000abcd&
gh_name=level_started&
gh_device_identifier=3sdf32sd324sdf234&
gh_session_identifier=a984ha893h287soh30w98hss&
gh_submitted_at=2012-01-01T08:03:19.0000000-04:00&
gh_recorded_at=2012-01-01T08:03:19.0000000-04:00&
version=1.2&
level=6&
equipment=[flashlight,axe,knife]
" -X POST http://www.mygamehud.com/api/v2/events