采用 HTTP POST 方式可以删除Data table中的现有条目.
它只允许通过一个请求删除一个条目.
参数 | 类型 | 描述 |
---|---|---|
ApiKey | string | 你的 API key, 用于身份验证. 必填 |
TableName | string | 数据表格名称. 必填 |
Filters | complex | 区分各个被删除条目的标识. 各个列元素值的集合 (包含多个column元素). 必填 |
Filters子元素:
参数 | 类型 | 描述 |
---|---|---|
Name | string | 列名称. 必填. |
Operator | string | 操作符. 必填. 可为下列中一个:
|
Value | string | 值. 必填. 见下面有效类型. |
有效值类型:
元素/属性 | 类型 | 描述 |
---|---|---|
Count | int | 已删除的记录数量. |
POST https://api.esv2.com/v2/Api/DataTablesDeleteRows/ HTTP/1.1
Accept-Encoding: gzip,deflate
User-Agent: Jakarta Commons-HttpClient/3.1
Host: api.esv2.com
Content-Length: 269
<ApiRequest xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xs=”http://www.w3.org/2001/XMLSchema”>
<ApiKey>MyTestApiKey</ApiKey>
<TableName>MyTable</TableName>
<Filters>
<Filter>
<Column>
<Name>id</Name>
<Operator>LE</Operator>
<Value>8</Value>
</Column>
</Filter>
<Filter>
<Column>
<Name>bool2</Name>
<Operator>EQ</Operator>
<Value>1</Value>
</Column>
</Filter>
</Filters>
</ApiRequest>
|
DELETE FROM MyTable WHERE id <= 8 AND bool2 = 1
HTTP/1.1 200 OK
Cache-Control: private
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 1.0
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Date: Wed, 28 Oct 2009 15:35:17 GMT
Content-Length: 0
<ApiResponse xmlns:xsd=”http://www.w3.org/2001/XMLSchema” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”>
<Count>1</Count>
</ApiResponse>
|
HTTP/1.1 400 Bad Request
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 1.0
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Date: Wed, 28 Oct 2009 11:32:07 GMT
Content-Length: 239
<ApiResponse xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema”>
<ErrorMessage>
<Code>400</Code>
<Message>No row matching specified criteria was found.</Message>
</ErrorMessage>
</ApiResponse>
|