更新表格属性
该接口用于根据 spreadsheetToken 更新表格属性,如更新表格标题。
请求
| 项目 | 值 |
|---|---|
| HTTP URL | https://open.feishu.cn/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/properties |
| HTTP Method | PUT |
| 支持的应用类型 | custom,isv |
| 权限要求 调用该 API 所需的权限。开启其中任意一项权限即可调用 开启任一权限即可 | drive:drive 查看、评论、编辑和管理云空间中所有文件 sheets:spreadsheet 查看、评论、编辑和管理电子表格 |
请求头
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| Authorization | string | 是 | user_access_token 或 tenant_access_token 值格式:"Bearer access_token" 示例值:"Bearer u-7f1bcd13fc57d46bac21793a18e560" 了解更多:如何选择与获取 access token |
| Content-Type | string | 是 | 固定值:"application/json; charset=utf-8" |
路径参数
| 参数 | 类型 | 描述 |
|---|---|---|
| spreadsheetToken | string | spreadsheet 的 token,获取方式见在线表格开发指南 |
请求体
| 参数 | 类型 | 必须 | 说明 |
|---|---|---|---|
| properties | 是 | spreadsheet 的属性 | |
| ∟title | string | 是 | spreadsheet 的标题,最大长度100个字符 |
请求体示例
json
{
"properties": {
"title": "string"
}
}cURL 请求示例
curl --location --request PUT 'https://open.feishu.cn/open-apis/sheets/v2/spreadsheets/shtcngNygNfuqhxTBf588jwgWbJ/properties' \
--header 'Authorization: Bearer t-e346617a4acfc3a11d4ed24dca0d0c0fc8e0067e' \
--header 'Content-Type: application/json' \
--data-raw '{
"properties":{
"title": " Title 1"
}
}'响应
响应体
| 参数 | 类型 | 说明 |
|---|---|---|
| spreadsheetToken | string | spreadsheet 的 token |
| title | string | spreadsheet 的标题 |
响应体示例
json
{
"code": 0,
"msg": "Success",
"data": {
"spreadsheetToken": "***",
"title": "***"
}
}错误码
具体可参考:服务端错误码说明
