Documentation

WriteTitleEvent

Writes a title-based event into PlayStream.

Request Details

This API is designed to write a multitude of different client-defined events into PlayStream. It supports a flexible JSON schema, which allowsfor arbitrary key-value pairs to describe any title-based event. The created event will be locked to the authenticated title.

WriteTitleEventRequest
Request Properties
Body Dict<String, object>

Custom event properties. Each property consists of a name (string) and a value (JSON object).

EventName (required) String

The name of the event, within the namespace scoped to the title. The naming convention is up to the caller, but it commonly follows the subject_verb_object pattern (e.g. player_logged_in).

Timestamp DateTime

The time (in UTC) associated with this event. The value dafaults to the current time.

POST https://{{TitleID}}.playfabapi.com/Client/WriteTitleEvent
    Content-Type: application/json
    X-Authentication: <user_session_ticket_value>
{
  "EventName": "client_update_submitted",
  "Timestamp": "2016-03-07T00:00:00Z",
  "Body": {
    "Version": "1.4.50"
  }
}
        

Response Details

WriteEventResponse
Result Properties
EventId String

The unique identifier of the event. The values of this identifier consist of ASCII characters and are not constrained to any particular format.

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "code": 200,
  "status": "OK",
  "data": {
    "EventId": "0f8fad5bd9cb469fa16570867728950e"
  }
}

Authentication

SessionTicket

Possible Error Codes

Name Code
InvalidEventField 1216
InvalidRequest 1071
NoWritePermissionsForEvent 1207