Share via


Delete record operation

 

Deletes an item from a table.

Request

The request may be specified as follows. Replace <service_name> with your mobile service name, <table_name> with the name of the table to access, and <item_id> with the ID of the item to be deleted.

HTTP Verb

Request URI

HTTP Version

DELETE

https://<service_name>.azure-mobile.net/tables/<table_name>/<item_id>

HTTP/1.1

URI Parameters

URI Parameter

Required

Description

noscript

No

When a value of true is supplied, the execution of registered scripts is suppressed. To suppress script execution, you must also supply the service master key in the X-ZUMO-MASTER header.

Request Headers

The following table describes the request headers.

Request Header

Required

X-ZUMO-APPLICATION

Conditional

The application key of the mobile service. You must specify a valid application key when required to access the table operation. This is the default table operation access permission.

X-ZUMO-AUTH

Conditional

The service-generated authentication token for an authenticated user. You must specify a token for an authenticated user when required to access the table operation.

X-ZUMO-MASTER

Conditional

The service master key. You should only include this key when administrator access is required to access the table operation.

System_CAPS_security Security Note

The service master key is a critical security credential that provides administrator access to your data service. Do not share this secret with anyone or distribute it with your app. This key must always be securely distributed over an encrypted channel.

Request Body

None.

Response

The response includes an HTTP status code and a set of response headers.

Status Code

A successfully operation returns status code 204 (No Content).

Response Headers

The response for this operation includes the following headers. The response may also include additional standard HTTP headers. All standard headers conform to the HTTP/1.1 protocol specification.

Response Header

Description

Content-Type

Header set to application/json.

x-zumo-version

Indicates which version of the runtime executed the request.

Response Body

None.

Authorization

Authorization depends on the access permission requirements for the table operation, which are summarized as follows:

Table operation access permission

Required authorization header

Everyone

None

Anybody with the application key

X-ZUMO-APPLICATION

Only Authenticated Users

X-ZUMO-AUTH

Only Scripts and Admins

X-ZUMO-MASTER

Access permissions for individual table operations are set in the Windows Azure Management Portal. For more information, see Permissions.

Sample Request and Response

The following example URI deletes an existing item from the TodoItem table.

DELETE https://todolist.azure-mobile.net/tables/TodoItem/18

The request is sent with the following headers.

X-ZUMO-APPLICATION: UzMAOXRlJdZyqibeUqCMoZZMrUXIRs92
Host: todolist.azure-mobile.net

After the request has been sent, the following response is returned.

HTTP/1.1 204 No Content
Content-Type: application/json
x-zumo-version: Zumo.Main.0.1.6.527.Runtime
Date: Thu, 20 Sep 2012 16:05:50 GMT

See Also

Operations on a table in Mobile Services
Azure Mobile Services REST API Reference