Skip to main content
Version: 5.7.0

UpdateEntity

Replaces the specified custom entity's data, and optionally updates the acl and expiry, on the server.

ServiceOperation
customEntityUPDATE_ENTITY

Method Parameters

ParameterDescription
entityTypeThe type of custom entity being updated.
entityIdThe id of custom entity being updated.
versionVersion of the custom entity being updated.
dataJsonNew custom data, as JSON, to replace existing custom data.
aclNew access control list settings to replace existing acl. Optional, ignored if null.
timeToLiveThe duration of time, in milliseconds, the custom entity should live from now before being expired. Null indicates never expires. To indicate no change, use -1.

Usage

http://localhost:3000
string entityType = "athletes";
string entityId = "aaaa-bbbb-cccc-dddd";
int version = 1;
string dataJson = "{\"firstName\":\"Super\",\"surName\":\"Star\",\"position\":\"defense\",\"goals\":3,\"assists\":5}";
string acl = "{\"other\":0}";
int timeToLive = null;
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.UpdateEntity(entityType, entityId, version, dataJson, acl, timeToLive, successCallback, failureCallback);
JSON Response
{
"status": 200,
"data": {
"entityId": "1497cc7e-66cb-4682-9eac-c755523369a8",
"version": 2,
"acl": {
"other": 1
},
"ownerId": null,
"expiresAt": null,
"timeToLive": null,
"createdAt": 1573540122600,
"updatedAt": 1573540142928
}
}