Documentation

SetObjects

Sets objects on an entity's profile.

Request Details

Sets JSON objects on the requested entity profile. May include a version number to be used to perform optimistic concurrency operations during update. If the current version differs from the version in the request the request will be ignored. If no version is set on the request then the value will always be updated if the values differ. Using the version value does not guarantee a write though, ConcurrentEditError may still occur if multiple clients are attempting to update the same profile.

SetObjectsRequest
Request Properties
Entity (required) EntityKey

The entity to perform this action on.

ExpectedProfileVersion int32

Optional field used for concurrency control. By specifying the previously returned value of ProfileVersion from GetProfile API, you can ensure that the object set will only be performed if the profile has not been updated by any other clients since the version you last loaded.

Objects (required) List<SetObject>

Collection of objects to set on the profile.

POST https://{{TitleID}}.playfabapi.com/Object/SetObjects
    Content-Type: application/json
{
  "ExpectedProfileVersion": 5,
  "Objects": [
    {
      "ObjectName": "SaveSate",
      "DataObject": {
        "PlayerDetails": {
          "LastMissionSuccess": "2017-06-15T11:05:19Z",
          "LastMissionFailure": "2017-06-12T11:05:19Z",
          "MapPosition": [
            22.0,
            37.78
          ],
          "IsPaidUpgrade": true
        },
        "GameSettings": {
          "Screen": "FriendsList",
          "Favorites": [
            "Place 1",
            "Place 2"
          ]
        }
      },
      "SimpleStatements": {
        "Read": [
          {
            "Friend": true
          }
        ],
        "Write": [
          "Self"
        ]
      }
    }
  ],
  "Entity": {
    "Id": "A8140AB9109712B",
    "Type": "title_player_account",
    "TypeString": "title_player_account"
  }
}
        

Response Details

SetObjectsResponse
Result Properties
ProfileVersion (required) int32

New version of the entity profile.

SetResults List<SetObjectInfo>

New version of the entity profile.

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "code": 200,
  "status": "OK",
  "data": {
    "SetResults": [
      {
        "SetResult": "Created"
      }
    ],
    "ProfileVersion": 5
  }
}

Authentication

EntityToken

Possible Error Codes

Name Code
EntityProfileVersionMismatch 1352