Skip to main content
Version: 5.7.0

CreateEntity

Method creates a new entity on the server.

ServiceOperation
entityCREATE

Method Parameters

ParameterDescription
entityTypeThe entity type as defined by the user
dataThe entity's data object
aclThe entity's Access Control List as object. A null ACL implies default permissions which make the entity readable/writeable by only the user.

Usage

http://localhost:3000
string entityType = "address";
string jsonEntityData = "{\"street\":\"1309 Carling\"}";
string jsonEntityAcl = "{\"other\":0}";
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.CreateEntity(entityType, jsonEntityData, jsonEntityAcl, successCallback, failureCallback);
JSON Response
{
"data": {
"createdAt": 1582645074383,
"entityType": "address",
"entityId": "6a3d791b-c6c9-416a-8b00-a95b17ea630f",
"acl": {
"other": 0
},
"version": 1,
"updatedAt": 1582645074383
},
"status": 200
}