Skip to content

更新表格属性

该接口用于根据 spreadsheetToken 更新表格属性,如更新表格标题。

请求

项目
HTTP URLhttps://open.feishu.cn/open-apis/sheets/v2/spreadsheets/:spreadsheetToken/properties
HTTP MethodPUT
支持的应用类型custom,isv
权限要求 调用该 API 所需的权限。开启其中任意一项权限即可调用 开启任一权限即可drive:drive 查看、评论、编辑和管理云空间中所有文件 sheets:spreadsheet 查看、评论、编辑和管理电子表格

请求头

名称类型必填描述
Authorizationstringuser_access_tokentenant_access_token 值格式:"Bearer access_token" 示例值:"Bearer u-7f1bcd13fc57d46bac21793a18e560" 了解更多:如何选择与获取 access token
Content-Typestring固定值:"application/json; charset=utf-8"

路径参数

参数类型描述
spreadsheetTokenstringspreadsheet 的 token,获取方式见在线表格开发指南

请求体

参数类型必须说明         
propertiesspreadsheet 的属性
 ∟titlestringspreadsheet 的标题,最大长度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"
    }
}'

响应

响应体

参数类型说明
spreadsheetTokenstringspreadsheet 的 token
titlestringspreadsheet 的标题

响应体示例

json
{
    "code": 0,
    "msg": "Success",
    "data": {
        "spreadsheetToken": "***",
        "title": "***"
    }
}

错误码

具体可参考:服务端错误码说明

内容来源:飞书开放平台 · 自动爬取整理