Skip to content
开发文档
能力中心
应用市场
WebOffice
开发者后台

获取 Schema

请求说明

请求地址https://openapi.wps.cn/v7/coop/dbsheet/{file_id}/schema
请求方法GET
签名方式KSO-1
权限要求管理多维表格(用户授权) kso.dbsheet.readwrite
查询多维表格(用户授权) kso.dbsheet.read
管理多维表格(用户授权) kso.dbsheet.readwrite
查询多维表格(用户授权) kso.dbsheet.read

请求头(Header)

Header 名称参数类型是否必填说明
Content-Typestring使用:application/json
X-Kso-DatestringRFC1123 格式的日期,例: Wed, 23 Jan 2013 06:43:08 GMT
X-Kso-AuthorizationstringKSO-1 签名值,详见《签名方法》
Authorizationstring授权凭证,格式为:Bearer {access_token}

路径参数(Path)

名称参数类型说明
file_idstring文件 id

请求地址示例

[GET] https://openapi.wps.cn/v7/coop/dbsheet/{file_id}/schema

响应体

名称参数类型说明
codeinteger响应代码。非 0 表示失败,参照《状态码说明》
msgstring响应信息
dataobject响应数据
∟ sheetsarray[object]
∟ ∟ fieldsarray[object]数据表字段,详见 多维表格参数说明
∟ ∟ idinteger数据表 id
∟ ∟ namestring数据表名称
∟ ∟ primary_field_idstring主要字段
∟ ∟ viewsarray[object]数据表视图,详见 多维表格参数说明
moreobject更多的错误信息

响应体示例

json
{
  "code": 0,
  "msg": "",
  "data": {
    "sheets": [
      {
        "id": 1,
        "name": "数据表",
        "views": [
          {
            "id": "B",
            "name": "表格视图",
            "type": "Grid"
          }
        ],
        "primary_field_id": "B",
        "fields": [
          {
            "name": "文本",
            "type": "MultiLineText",
            "id": "B",
            "data": {
              "unique_value": false
            }
          },
          {
            "name": "数字",
            "type": "Number",
            "id": "C",
            "data": {
              "number_format": "0.00_ "
            }
          },
          {
            "name": "日期",
            "type": "Date",
            "id": "D",
            "data": {
              "default_value": "",
              "default_value_type": "Normal",
              "number_format": "yyyy/mm/dd;@"
            }
          },
          {
            "name": "单选项",
            "type": "SingleSelect",
            "id": "E",
            "data": {
              "allow_add_item_while_inputting": true,
              "items": [
                {
                  "color": 4292930553,
                  "id": "B",
                  "value": "选项1"
                },
                {
                  "color": 4292671479,
                  "id": "C",
                  "value": "选项2"
                },
                {
                  "color": 4293064163,
                  "id": "D",
                  "value": "选项3"
                }
              ]
            }
          },
          {
            "name": "图片和附件",
            "type": "Attachment",
            "id": "F",
            "data": {
              "only_upload_by_camera": false
            }
          },
          {
            "name": "等级",
            "type": "Rating",
            "id": "G",
            "data": {
              "max": 5
            }
          }
        ]
      }
    ]
  }
}
回到旧版