条目删除

Delete row 条目删除

采用 HTTP POST 方式可以删除Data table中的现有条目.
它只允许通过一个请求删除一个条目.

请求数据格式

请求URL参数:
参数 类型 描述
ApiKey string 你的 API key, 用于身份验证. 必填
TableName string 数据表格名称. 必填
PrimaryKeyColumns complex 区分各个被删除条目的标识. 各个列元素值的集合 (包含多个column元素). 必填

Column子元素:

参数 类型 描述
Name string 列名称. 必填
Value. string 所赋的值. 必填

示例:

请求 (根据单一主键从数据表格删除一条记录):
POST https://api.esv2.com/v2/Api/DataTablesDeleteRow/ 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>test_api_key1</ApiKey>
   <TableName>Table1</TableName>
   <PrimaryKeyColumns>
     <Column>
        <Name>Id</Name>
        <Value>1</Value>
     </Column>
   </PrimaryKeyColumns>
</ApiRequest>
OK应答:
HTTP/1.1 204 No Content
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
错误应答:
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>

请求 (根据多重主键从数据表格删除一条记录):

POST https://api.esv2.com/v2/Api/DataTablesDeleteRow/ HTTP/1.1
Accept-Encoding: gzip,deflate
User-Agent: Jakarta Commons-HttpClient/3.1
Host: api.esv2.com
Content-Length: 321
<ApiRequest xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xs=”http://www.w3.org/2001/XMLSchema”>
   <ApiKey>test_api_key1</ApiKey>
   <TableName>Table1</TableName>
   <PrimaryKeyColumns>
     <Column>
        <Name>Column1</Name>
        <Value>1</Value>
     </Column>
     <Column>
        <Name>Column2</Name>
        <Value>value2</Value>
     </Column>
   </PrimaryKeyColumns>
</ApiRequest>