删除条件格式
删除已有的条件格式。支持跨工作表删除多个条件格式。
使用限制
单次调用该接口,最多支持删除 10 个条件格式。
请求
| 项目 | 值 |
|---|---|
| HTTP URL | https://open.feishu.cn/open-apis/sheets/v2/spreadsheets/:spreadsheet_token/condition_formats/batch_delete |
| HTTP Method | DELETE |
| 接口频率限制 | 100 次/秒 |
| 支持的应用类型 | custom,isv |
| 权限要求 调用该 API 所需的权限。开启其中任意一项权限即可调用 开启任一权限即可 | drive:drive 查看、评论、编辑和管理云空间中所有文件 sheets:spreadsheet 查看、评论、编辑和管理电子表格 |
请求头
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| Authorization | string | 是 | 通过访问凭证(access_token)对调用者身份进行鉴权。可选值: - tenant_access_token: 租户授权凭证。应用代表租户(即企业或团队)执行对应操作。示例值:"Bearer t-7f1bcd13fc57d46bac21793aabcef" - user_access_token:用户授权凭证。应用代表用户执行对应操作。示例值:"Bearer u-7f1bcd13fc57d46bac21793aabcef" 了解更多,参考获取访问凭证。 |
| Content-Type | string | 是 | 固定值:"application/json; charset=utf-8" |
路径参数
| 名称 | 类型 | 描述 |
|---|---|---|
| spreadsheet_token | string | 电子表格的 token。可通过以下两种方式获取。了解更多,参考电子表格概述。 - 电子表格的 URL:https://sample.feishu.cn/sheets/==Iow7sNNEphp3WbtnbCscPqabcef== - 调用获取文件夹中的文件清单 |
请求体
| 参数 | 类型 | 说明 |
|---|---|---|
sheet_cf_ids | array | 要删除的电子表格条件格式的 ID。最多可删除 10 个条件格式。 注意: 响应体中将返回每个条件格式的删除结果,包括成功或具体的失败信息。 |
└ sheet_id | string | 电子表格工作表的 ID。调用获取工作表获取 ID。 |
└ cf_id | string | 条件格式的 ID。调用获取条件格式获取 ID。 |
请求体示例
json
{
"sheet_cf_ids": [
{
"sheet_id": "40a7b0",
"cf_id": "6hP6Dj6gsd"
}
]
}cURL 请求示例
bash
curl --location --request DELETE 'https://open.feishu.cn/open-apis/sheets/v2/spreadsheets/shtcngNygNfuqhxTBf588jwgWbJ/condition_formats/batch_delete' \
--header 'Authorization: Bearer t-e346617a4acfc3a11d4ed24dca0d0c0fc8e0067e' \
--header 'Content-Type: application/json' \
--data-raw '{
"sheet_cf_ids": [
{
"sheet_id": "Q7PlXT",
"cf_id": "KjRm0JyS1P"
}
]
}'响应
响应体
| 参数 | 类型 | 说明 |
|---|---|---|
code | int | 错误码,非 0 表示失败。 |
msg | string | 错误描述 |
data | / | / |
└ responses | array<interface> | 响应信息 |
└ sheet_id | string | 工作表的 ID |
└ cf_id | string | 删除的条件格式的 ID |
└ res_code | int | 条件格式删除的状态码。0 表示成功创建,非 0 表示失败。 |
└ res_msg | string | 删除当前条件格式返回的状态信息,success 表示成功,非 success 将返回失败原因。 |
响应体示例
json
{
"code": 0,
"data": {
"responses": [
{
"cf_id": "6hP6Dj6gsd",
"res_code": 555554047,
"res_msg": "cfId not exist",
"sheet_id": "40a7b0"
}
]
},
"msg": "Success"
}错误码
具体可参考:服务端错误码说明
