Writes a character-based event into PlayStream.

Request Details

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.

Request Properties
Body Dict<String, object>

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

CharacterId (required) String

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

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

PlayFabId (required) String

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

Timestamp DateTime

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

POST https://{{TitleID}}
    Content-Type: application/json
    X-SecretKey: <developer_secret_key>
  "PlayFabId": "3947655299CB786",
  "CharacterId": "E161CB4B7F6C34B",
  "EventName": "character_defeated_enemy",
  "Timestamp": "2016-03-07T00:00:00Z",
  "Body": {
    "Enemy": "guardian",
    "Damage": 5,
    "Coordinates": {
      "X": 123.4,
      "Y": 543.2

Response Details

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"



Possible Error Codes

Name Code
CharacterNotFound 1135
InvalidRequest 1071
NoWritePermissionsForEvent 1207