Object - Set Objects

Sets objects on an entity's profile.

POST https://titleId.playfabapi.com/Object/SetObjects

Request Header

Name Required Type Description
X-EntityToken True
  • string

This API requires an Entity Session Token, available from the Entity GetEntityToken method.

Request Body

Name Required Type Description
Entity True

The entity to perform this action on.

Objects True

Collection of objects to set on the profile.

CustomTags
  • object

The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).

ExpectedProfileVersion
  • number

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.

Responses

Name Type Description
200 OK
400 Bad Request

This is the outer wrapper for all responses with errors

Security

X-EntityToken

This API requires an Entity Session Token, available from the Entity GetEntityToken method.

Type: apiKey
In: header

Definitions

ApiErrorWrapper

The basic wrapper around every failed API response

EntityKey

Combined entity type and ID structure which uniquely identifies a single entity.

OperationTypes
SetObject
SetObjectInfo
SetObjectsRequest

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.

SetObjectsResponse

ApiErrorWrapper

The basic wrapper around every failed API response

Name Type Description
code
  • integer

Numerical HTTP code

error
  • string

Playfab error code

errorCode
  • integer

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

EntityKey

Combined entity type and ID structure which uniquely identifies a single entity.

Name Type Description
Id
  • string

Unique ID of the entity.

Type
  • string

Entity type. See https://docs.microsoft.com/gaming/playfab/features/data/entities/available-built-in-entity-types

OperationTypes

Name Type Description
Created
  • string
Deleted
  • string
None
  • string
Updated
  • string

SetObject

Name Type Description
DataObject
  • object

Body of the object to be saved. If empty and DeleteObject is true object will be deleted if it exists, or no operation will occur if it does not exist. Only one of Object or EscapedDataObject fields may be used.

DeleteObject
  • boolean

Flag to indicate that this object should be deleted. Both DataObject and EscapedDataObject must not be set as well.

EscapedDataObject
  • string

Body of the object to be saved as an escaped JSON string. If empty and DeleteObject is true object will be deleted if it exists, or no operation will occur if it does not exist. Only one of DataObject or EscapedDataObject fields may be used.

ObjectName
  • string

Name of object. Restricted to a-Z, 0-9, '(', ')', '_', '-' and '.'.

SetObjectInfo

Name Type Description
ObjectName
  • string

Name of the object

OperationReason
  • string

Optional reason to explain why the operation was the result that it was.

SetResult

Indicates which operation was completed, either Created, Updated, Deleted or None.

SetObjectsRequest

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.

Name Type Description
CustomTags
  • object

The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).

Entity

The entity to perform this action on.

ExpectedProfileVersion
  • number

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

Collection of objects to set on the profile.

SetObjectsResponse

Name Type Description
ProfileVersion
  • number

New version of the entity profile.

SetResults

New version of the entity profile.