DeleteEntity
Method deletes the given entity on the server.
This method is affected by versioning. See the versioning documentation for more information.
Service | Operation |
---|---|
entity | DELETE |
Method Parameters
Parameter | Description |
---|---|
entityId | The id of the entity to delete |
version | The version of the entity to delete. Use -1 to indicate the newest version |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string entityId = "someEntityId";
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.DeleteEntity(entityId, version, successCallback, failureCallback);
const char *entityId = "someEntityId";
int version = -1;
_bc->getEntityService()->deleteEntity(entityId, version, this);
NSString *entityId = @"someEntityId";
int version = -1;
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc entityService] deleteEntity:entityId
version:version
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
String entityId = "someEntityId";
int version = -1;
this; // implements IServerCallback
_bc.getEntityService().deleteEntity(entityId, version, this);
public void serverCallback(ServiceName serviceName, ServiceOperation serviceOperation, JSONObject jsonData)
{
System.out.print(String.format("Success | %s", jsonData.toString()));
}
public void serverError(ServiceName serviceName, ServiceOperation serviceOperation, int statusCode, int reasonCode, String jsonError)
{
System.out.print(String.format("Failed | %d %d %s", statusCode, reasonCode, jsonError.toString()));
}
var entityId = "someEntityId";
var version = -1;
_bc.entity.deleteEntity(entityId, version, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var entityId = "someEntityId";
var version = -1;
ServerResponse result = await _bc.entityService.deleteEntity(entityId:entityId, version:version);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var entityId = "someEntityId";
var version = -1;
var entityProxy = bridge.getEntityServiceProxy();
var postResult = entityProxy.deleteEntity(entityId, version);
if (postResult.status == 200) {
// Success!
}
{
"service": "entity",
"operation": "DELETE",
"data": {
"entityId": "someEntityId",
"version": -1
}
}
JSON Response
{
"status":200,
"data":null
}
Common Error Code
Status Codes
Code | Name | Description |
---|---|---|
40344 | ENTITY_VERSION_MISMATCH | The version parameter does not match the current version on the server |