Skip to main content
Version: 5.7.0

UpdateEntity

Method updates an entity on the server. This operation results in the entity data being completely replaced by the passed in JSON string.

This method is affected by versioning. See the versioning documentation for more information.

ServiceOperation
entityUPDATE

Method Parameters

ParameterDescription
entityIdThe id of the entity to update
entityTypeThe entity type as defined by the user
jsonEntityDataThe entity's data object
jsonEntityAclThe entity's Access Control List as object. A null ACL implies default permissions which make the entity readable/writeable by only the user.
versionThe version of the entity to update. Use -1 to indicate the newest version

Usage

http://localhost:3000
string entityId = "someEntityId";
string entityType = "address";
string jsonEntityData = "{\"street\":\"1309 Carling Avenue, Ottawa, ON\"}";
string jsonEntityAcl = "{\"other\":0}";
int version = -1;
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.EntityService.UpdateEntity(entityId, entityType, jsonEntityData, jsonEntityAcl, version, successCallback, failureCallback);
JSON Response
{
"status": 200,
"data": {
"entityId": "113db68a-48ad-4fc9-9f44-5fd36fc6445f",
"entityType": "person",
"version": 1,
"data": {
"name": "john",
"age": 30
},
"acl": {
"other": 0
},
"createdAt": 1395943044322,
"updatedAt": 1395943044322
}
}
Common Error Code

Status Codes

CodeNameDescription
40332UPDATE_FAILEDAn update operation failed. Used for entities, global entities, and updates on the user.