查询工作表信息

... 2022-12-6 大约 2 分钟

# 查询工作表信息

# 接口说明

本接口用于查询工作表的基本信息:

  1. 所有子表的 sheetID
  2. 所有子表标题
  3. 所有子表大小(行列数)
  4. 所有子表已使用的行列数 (耗时可能较长,若不需要该数据可以通过设置路径参数 concise=1 快速返回其他信息)

# 权限说明

本接口需要拥有以下任意一项权限:

  • scope.sheet
  • scope.sheet.readonly

# 请求格式

描述 定义
Path /openapi/spreadsheet/v3/files/{fileId}
Method GET
Accept application/json

# 请求头部

详见Headers

# 请求参数

参数名 类型 必选 描述
fileId string 在线表格唯一标识

# 查询参数

参数名 类型 必选 描述
concise int 0: 返回完整的子表信息
1: 返回不包含子表使用行列数的子表信息

# 请求体

# 响应参数

# 响应体

参数名 类型 描述
code integer 业务返回码
message string 业务返回码描述
properties array(Properties) 在线表格中各工作表的元数据

# 请求包体

GET /openapi/spreadsheet/v3/files/300000000$AAAAAAAAAAAA?consie=1 HTTP/1.1
Host: docs.qq.com
Access-Token: ACCESS_TOKEN
Client-Id: CLIENT_ID
Open-Id: OPEN_ID
Content-Length: 0
1
2
3
4
5
6
1
2
3
4
5
6

# 示例

curl --location --request GET 'https://docs.qq.com/openapi/spreadsheet/v3/files/300000000$AAAAAAAAAAAA?concise=1' \
--header 'Access-Token: ACCESS_TOKEN' \
--header 'Client-Id: CLIENT_ID' \
--header 'Open-Id: OPEN_ID'
1
2
3
4
1
2
3
4

# 响应包体

HTTP/1.1 200 OK
Date: Thu, 28 Jul 2022 15:34:46 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 3
Connection: keep-alive
 
{"properties":[{"sheetId":"BB08J2", "title":"工作表1", "rowCount":0, "columnCount":0}, "rowTotal": 150, "columnTotal": 26]}
1
2
3
4
5
6
7
1
2
3
4
5
6
7

# 错误码

HTTP 状态码 业务错误码 描述 排查建议
400 400001 请求参数错误 确认传入的参数是否合法
401 400006 该操作未授权 确认对操作的资源是否具有相应的授权,以及用户票据是否正确
429 400007 请求数超过限制 请求数超过限频,请降低调用频率
500 400010 服务内部错误 服务端错误,请联系开发者

查询更多业务返回码

上次编辑于: 2024年3月21日 15:58
贡献者: weixinqiu , livlin , muyanyang , mylochen