Analytics - Write Character Event

Writes a character-based event into PlayStream.

POST https://titleId.playfabapi.com/Server/WriteCharacterEvent

Request Body

Name Required Type Description
Body
  • object

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

CharacterId True
  • string

Unique PlayFab assigned ID for a specific character owned by a user

EventName True
  • 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).

PlayFabId True
  • string

Unique PlayFab assigned ID of the user on whom the operation will be performed.

Timestamp
  • string

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

Responses

Name Type Description
200 OK
400 Bad Request

This is the outer-wrapper for all responses with errors

Security

SecretKey

This API requires a title secret key, available to title admins, from PlayFab Game Manager.

Type: apiKey
In: header

Definitions

ApiErrorWrapper

The basic wrapper around every failed API response

WriteEventResponse
WriteServerCharacterEventRequest

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

ApiErrorWrapper

The basic wrapper around every failed API response

Name Type Description
code
  • number

Numerical HTTP code

error
  • string

Playfab error code

errorCode
  • number

Numerical Playfab error code

errorDetails
  • object

Detailed description of individual issues with the request object

errorMessage
  • string

Description for the Playfab errorCode

status
  • string

String HTTP code

WriteEventResponse

Name Type Description
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.

WriteServerCharacterEventRequest

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

Name Type Description
Body
  • object

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

CharacterId
  • string

Unique PlayFab assigned ID for a specific character owned by a user

EventName
  • 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).

PlayFabId
  • string

Unique PlayFab assigned ID of the user on whom the operation will be performed.

Timestamp
  • string

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

Error Codes

Name Code
CharacterNotFound 1135
InvalidRequest 1071
NoWritePermissionsForEvent 1207