logo
开发者文档
搜索
删除表数据

删除表数据

可以通过该接口,批量删除 Agent 数据表中的指定记录数据的值,最大支持删除 1000 条记录。

请求方式

POST

调用地址

https://api-${endpoint}/v2/database/delete/record

调用验证

详情参见 API 概述 的鉴权方式说明。

请求

请求示例

curl -X POST 'https://api-${endpoint}/v2/database/delete/record' \ -H 'Authorization: Bearer ${API Key}' \ -H 'Content-Type: application/json' \ -d '{ "table_id": "673af861ed69656ac0895b07", "delete_data":[ { "record_id":"123456", }, { "filter": { "id": "789" } ] }'
                      
                      curl -X POST 'https://api-${endpoint}/v2/database/delete/record' \
-H 'Authorization: Bearer ${API Key}' \
-H 'Content-Type: application/json' \
-d '{
      "table_id": "673af861ed69656ac0895b07",
      "delete_data":[
        {
          "record_id":"123456",
        },
        {  
          "filter": {
          "id": "789"
        }
      ]
    }'

                    
此代码块在浮窗中显示

请求头

字段 类型 描述
Authorization Bearer ${API Key} 使用Authorization: Bearer ${API Key}进行调用验证,请在 API 密钥页面获取密钥作为API Key
Content-Type application/json 数据类型,取值为 application/json。

请求体

字段 类型 必填 描述
table_id string 表id。
delete_data array 删除数据集合。
record_id string record id 与 filter 条件二选一,推荐使用 record_id 。
filter map 用户自定义过滤条件(必须使用自定义唯一主键字段)。

注意:record_id 与 filter 条件必须二选一,推荐使用 record_id 。当两者都传入时,以 record_id 为准。

响应

响应示例

{ "code": 0, "message": "OK" }
                      
                      {
    "code": 0,
    "message": "OK"
}

                    
此代码块在浮窗中显示

成功响应

字段 类型 描述
code int 消息的类型编码。
message string 消息描述。

失败响应

字段 类型 描述
code int 错误码。
message string 错误详情。

错误码

Code Message
40000 参数错误
50000 系统内部错误
403106 未找到表
403131 无权访问数据表