Method: events.record

Records a batch of changes to the number of times events have occurred for the currently authenticated user of this application.

HTTP request

POST https://games.googleapis.com/games/v1/events

Query parameters

Parameters
language

string

The preferred language to use for strings returned by this method.

Request body

The request body contains an instance of EventsUpdates.

Response body

An event period update resource.

If successful, the response body contains data with the following structure:

JSON representation
{
  "kind": string,
  "batchFailures": [
    {
      object (EventBatchRecordFailure)
    }
  ],
  "eventFailures": [
    {
      object (EventRecordFailure)
    }
  ],
  "playerEvents": [
    {
      object (PlayerEvent)
    }
  ]
}
Fields
kind

string

Uniquely identifies the type of this resource. Value is always the fixed string games#eventUpdateResponse.

batchFailures[]

object (EventBatchRecordFailure)

Any batch-wide failures which occurred applying updates.

eventFailures[]

object (EventRecordFailure)

Any failures updating a particular event.

playerEvents[]

object (PlayerEvent)

The current status of any updated events

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/games
  • https://www.googleapis.com/auth/games_lite

For more information, see the OAuth 2.0 Overview.

EventsUpdates

An event period update resource.

JSON representation
{
  "kind": string,
  "requestId": string,
  "currentTimeMillis": string,
  "timePeriods": [
    {
      object (EventPeriodUpdate)
    }
  ]
}
Fields
kind

string

Uniquely identifies the type of this resource. Value is always the fixed string games#eventRecordRequest.

requestId

string (int64 format)

The request ID used to identify this attempt to record events.

currentTimeMillis

string (int64 format)

The current time when this update was sent, in milliseconds, since 1970 UTC (Unix Epoch).

timePeriods[]

object (EventPeriodUpdate)

A list of the time period updates being made in this request.

EventPeriodUpdate

An event period update resource.

JSON representation
{
  "timePeriod": {
    object (EventPeriodRange)
  },
  "updates": [
    {
      object (EventUpdateRequest)
    }
  ],
  "kind": string
}
Fields
timePeriod

object (EventPeriodRange)

The time period being covered by this update.

updates[]

object (EventUpdateRequest)

The updates being made for this time period.

kind

string

Uniquely identifies the type of this resource. Value is always the fixed string games#eventPeriodUpdate.

EventPeriodRange

An event period time range.

JSON representation
{
  "kind": string,
  "periodStartMillis": string,
  "periodEndMillis": string
}
Fields
kind

string

Uniquely identifies the type of this resource. Value is always the fixed string games#eventPeriodRange.

periodStartMillis

string (int64 format)

The time when this update period begins, in millis, since 1970 UTC (Unix Epoch).

periodEndMillis

string (int64 format)

The time when this update period ends, in millis, since 1970 UTC (Unix Epoch).

EventUpdateRequest

An event period update resource.

JSON representation
{
  "definitionId": string,
  "updateCount": string,
  "kind": string
}
Fields
definitionId

string

The ID of the event being modified in this update.

updateCount

string (int64 format)

The number of times this event occurred in this time period.

kind

string

Uniquely identifies the type of this resource. Value is always the fixed string games#eventUpdateRequest.

EventBatchRecordFailure

A batch update failure resource.

JSON representation
{
  "range": {
    object (EventPeriodRange)
  },
  "failureCause": enum (EventFailureCause),
  "kind": string
}
Fields
range

object (EventPeriodRange)

The time range which was rejected; empty for a request-wide failure.

failureCause

enum (EventFailureCause)

The cause for the update failure.

kind

string

Uniquely identifies the type of this resource. Value is always the fixed string games#eventBatchRecordFailure.

EventFailureCause

Possible values for an event failure cause.

Enums
TOO_LARGE A batch request was issued with more events than are allowed in a single batch.
TIME_PERIOD_EXPIRED A batch was sent with data too far in the past to record.
TIME_PERIOD_SHORT A batch was sent with a time range that was too short.
TIME_PERIOD_LONG A batch was sent with a time range that was too long.
ALREADY_UPDATED An attempt was made to record a batch of data which was already seen.
RECORD_RATE_HIGH An attempt was made to record data faster than the server will apply updates.

EventRecordFailure

An event update failure resource.

JSON representation
{
  "eventId": string,
  "failureCause": enum (EventUpdateFailureCause),
  "kind": string
}
Fields
eventId

string

The ID of the event that was not updated.

failureCause

enum (EventUpdateFailureCause)

The cause for the update failure.

kind

string

Uniquely identifies the type of this resource. Value is always the fixed string games#eventRecordFailure.

EventUpdateFailureCause

Possible values for the cause of an event update failure.

Enums
NOT_FOUND An attempt was made to set an event that was not defined.
INVALID_UPDATE_VALUE An attempt was made to increment an event by a non-positive value.