Skip to content

Deleting Single Object

Method

DELETE

Endpoint URL

The xxxx.backendless.app is a subdomain assigned to your application. For more information see the Client-side Setup section of this documentation.

https://xxxx.backendless.app/api/data/<table-name>/<object-id> 

where:

Argument                Description
<table-name> name of the table where the object needs to be deleted.
<object-id> ID of the object to delete. The ID assigned by Backendless in the create object operation.

Request Headers

user-token:value-of-the-user-token-header-from-login

where:

Argument                Description
user-token Optional header. Contains a value returned by Backendless in a preceding user Login API call. If user-token is set in the request, the operation will be executed with the security policy associated with the currently logged in user. This means all permissions associated with the user and roles assigned to the user will be enforced by Backendless.

Request Body

None

Return Value

{  
  "deletionTime" : timestamp in milliseconds  
}

Example

curl \  
-X DELETE \  
-v https://xxxx.backendless.app/api/data/Orders/6C77C11B-E9B3-EB14-FFA2-69F38CF48800

Codeless Reference

data_service_delete_object

where:

Argument                Description
table name Name of the data table where an object will be deleted from.
object or objectId This parameter expects either a unique identifier(objectId) of the record that must be deleted in the data table, or a data object which must contain the objectId property which identifies the object in the database. String value or number.

This operation does not return a value.

Consider the following records in the employees data table:

data_service_example_delete_object

The example below deletes the object associated with the objectId: "8948E66F-67DE-441B-A7F8-DAB89965E27C".

data_service_example_delete_object_2

The result of this operation will look as shown below after the Codeless logic runs. As you can see, the object with the name "Bob Smith" associated with the objectId: "8948E66F-67DE-441B-A7F8-DAB89965E27C" has been deleted from the data table.

data_service_example_delete_object_3

You can also delete a record from the data table by passing an object to the operation. The object must have the objectId property and the unique identifier of the record that must be deleted. The example below deletes a record from the data table using an object that contains the following objectId: "FEA94D74-BEA1-4F28-BDDD-FB22CFEB747E"

data_service_example_delete_object_4

The result of this operation is a deleted record from the employees data table:

data_service_example_delete_object_5