- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- PlayerGameEvent
- PropertyValue
- Status
- Try it!
Records a batch of player game events for a specific player. This method allows sending multiple events in a single request.
HTTP request
POST https://games.googleapis.com/games/v1/players/{playerId}/gameStats:batchRecordEvents
Path parameters
| Parameters | |
|---|---|
playerId |
Required: The player ID of the player that performed the events. |
Request body
The request body contains data with the following structure:
| JSON representation |
|---|
{
"packageName": string,
"requestTime": string,
"events": [
{
object ( |
| Fields | |
|---|---|
packageName |
Required: Application package name (e.g., "com.example.game"). |
requestTime |
Required: The time from the client when this specific batch of events was submitted. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
events[] |
Required: A list of player game events to be recorded. Maximum of 30 events per batch request. |
Response body
A successful response indicates that the batch of events has been processed.
If successful, the response body contains data with the following structure:
| JSON representation |
|---|
{
"failedRequests": {
integer: {
object ( |
| Fields | |
|---|---|
failedRequests |
Map of failed events, keyed by their zero-based index in An object containing a list of |
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/gameshttps://www.googleapis.com/auth/games_lite
For more information, see the OAuth 2.0 Overview.
PlayerGameEvent
A representation of a single player game event triggered by a player's event in a game. This might be completing a level, unlocking an item, or finishing a match.
| JSON representation |
|---|
{
"eventId": string,
"eventName": string,
"eventProperties": {
string: {
object ( |
| Fields | |
|---|---|
eventId |
Required: A unique client-generated UUID for this specific event instance. Used for server-side idempotency and deduplication. Submitting an event with a previously recorded eventId for the same player will be ignored. |
eventName |
Required: Client-defined name of the event (e.g., "run_completed", "level_up"). Maximum length: 100 characters. |
eventProperties |
Optional: Key-value properties providing details about the event. - Maximum number of properties: 25. - Property key maximum length: 100 characters. - String values within PropertyValue maximum length: 1024 characters. An object containing a list of |
eventTime |
Required: The time from the client when this specific event was performed. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
PropertyValue
Wrapper for the value.
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field value. The value of the scalar. value can be only one of the following: |
|
intValue |
An integer value. |
doubleValue |
A double value. |
stringValue |
A string value. |
boolValue |
A boolean value. |
Status
The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC. Each Status message contains three pieces of data: error code, error message, and error details.
You can find out more about this error model and how to work with it in the API Design Guide.
| JSON representation |
|---|
{ "code": integer, "message": string, "details": [ { "@type": string, field1: ..., ... } ] } |
| Fields | |
|---|---|
code |
The status code, which should be an enum value of |
message |
A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the |
details[] |
A list of messages that carry the error details. There is a common set of message types for APIs to use. An object containing fields of an arbitrary type. An additional field |