Skip to main content
Version: 5.7.0

UpdateSharedEntity

Method updates a shared entity owned by another user. 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_SHARED

Method Parameters

ParameterDescription
entityIdThe id of the entity to update
targetProfileIdThe id of the entity's owner
entityTypeThe entity type as defined by the user
dataThe entity's data object
versionThe version of the entity to update. Use -1 to indicate the newest version

Usage

http://localhost:3000
string entityId = "someEntityId";
string targetProfileId = "someProfileId";
string entityType = "address";
string jsonEntityData = "{\"street\":\"1309 Carling Avenue, Ottawa, ON\"}";
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.UpdateSharedEntity(entityId, targetProfileId, entityType, jsonEntityData, 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.