Skip to main content
Version: 5.7.0

UpdateSingletonFields

Partially updates the data, of the singleton owned by the user for the specified custom entity type, with the specified fields, on the server.

ServiceOperation
customEntityUPDATE_SINGLETON_FIELDS

Method Parameters

ParameterDescription
entityTypeThe type of custom entity singleton being updated. Custom entity type must have option isOwned set to true.
versionVersion of the custom entity singleton being updated.
fieldsJsonSpecific fields, as JSON, to set within singleton entity's custom data.

Usage

http://localhost:3000
string entityType = "athletes";
int version = 1;
string fieldsJson = "{\"goals\":3,\"assists\":5}";
SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("Failed | {0} {1} {2}", status, code, error));
};

_bc.CustomEntityService.UpdateSingletonFields(entityType, version, fieldsJson, successCallback, failureCallback);
JSON Response
{
"data": {
"version": 2,
"updatedAt": 1591821018374
},
"status": 200
}