获取范围内的表格信息

... 2022-10-26 大约 2 分钟

# 获取范围内的表格信息

# 接口说明

本接口用于获取指定范围内的在线表格信息,单次查询的范围大小需满足以下限制:

  1. 查询范围行数 <=1000
  2. 查询范围列数 <=200
  3. 范围内的总单元格数量 <=10000

# 权限说明

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

  • scope.sheet
  • scope.sheet.readonly

# 请求格式

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

# 请求头部

详见Headers

# 请求参数

参数名 类型 必选 描述
fileId string 在线表格唯一标识
sheetId string 工作表ID,工作表的唯一标识
range string 查询的范围,格式遵循 A1表示法

# 查询参数

# 请求体

# 响应参数

# 响应体

参数名 类型 描述
code integer 业务返回码
message string 业务返回码描述
gridData object(gridData) 请求范围内的表格信息

# 请求示例

curl --location --request GET 'https://docs.qq.com/openapi/spreadsheet/v3/files/ABCDE123abcde/BB08J2/A10:D11' \
--header 'Access-Token:  {ACCESS_TOKEN}' \
--header 'Open-Id: {OPEN_ID}' \
--header 'Client-Id: {CLIENT_ID}'
1
2
3
4
1
2
3
4

# 响应包体

{
  "ret": 0,
  "msg": "Succeed",
  "data": {
    "gridData": {
      "columnMetadata": [],
      "rowMetadata": [],
      "rows": [
        {
          "values": [
            {
              "cellFormat": null,
              "cellValue": {
                "location": {
                  "name": "科兴科学园",
                  "latitude": "113.943575",
                  "longitude": "22.548204",
                  "source": "tencentmap",
                  "uid": "13189632714214169742"
                }
              },
              "dataType": "LOCATION"
            },
            {
              "cellFormat": null,
              "cellValue": {
                "text": "test"
              },
              "dataType": "DATA_TYPE_UNSPECIFIED"
            },
            {
              "cellFormat": null,
              "cellValue": {
                "text": "testing"
              },
              "dataType": "DATA_TYPE_UNSPECIFIED"
            },
            {
              "cellFormat": null,
              "cellValue": {
                "text": ""
              },
              "dataType": "DATA_TYPE_UNSPECIFIED" 
            }
          ]
        },
        {
          "values": [
            {
              "cellFormat": null,
              "cellValue": {
                "location": {
                  "name": "深圳市宝安人民医院",
                  "latitude": "113.914503",
                  "longitude": "22.561882",
                  "source": "tencentmap",
                  "uid": "6977409163354664674"
                }
              },
              "dataType": "LOCATION"
            },
            {
              "cellFormat": null,
              "cellValue": {
                "text": "this is not empty"
              },
              "dataType": "DATA_TYPE_UNSPECIFIED"
            },
            {
              "cellFormat": null,
              "cellValue": {
                "text": "yeah"
              },
              "dataType": "DATA_TYPE_UNSPECIFIED"
            },
            {
              "cellFormat": null,
              "cellValue": {
                "text": ""
              },
              "dataType": "DATA_TYPE_UNSPECIFIED"
            }
          ]
        }
      ],
      "startColumn": 0,
      "startRow": 9
    }
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90

# 错误码

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

查询更多业务返回码

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