Documentation

WriteEvents

Write batches of entity based events to PlayStream.

Request Details

WriteEventsRequest
Request Properties
Events (required) List<EventContents>

Collection of events to write to PlayStream.

POST https://{{TitleID}}.playfabapi.com/Event/WriteEvents
    Content-Type: application/json
{
  "Events": [
    {
      "Entity": {
        "Id": "A8140AB9109712B",
        "Type": "title",
        "TypeString": "title"
      },
      "EventNamespace": "com.playfab.events.example",
      "Name": "something_happened",
      "Payload": {
        "Foo": "Bar",
        "Nums": [
          1,
          2,
          3
        ]
      },
      "Namespace": "com.playfab.events.example"
    }
  ]
}
        

Response Details

WriteEventsResponse
Result Properties
AssignedEventIds List<String>

The unique identifiers assigned by the server to the events, in the same order as the events in the request. Only returned if FlushToPlayStream option is true.

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "code": 200,
  "status": "OK",
  "data": {
    "AssignedEventIds": [
      "496b598a05404142a6b6349c8cb29459"
    ]
  }
}

Authentication

EntityToken

Possible Error Codes

Name Code
EventEntityNotAllowed 1372
EventNamespaceNotAllowed 1371
InvalidJSONContent 1200
NotAuthenticated 1074
NotAuthorized 1089
OverLimit 1214
ProfileDoesNotExist 1298