5 Answers

还有一下请求看不出来哪里有问题 curl --location 'https://openapi.wps.cn/v7/coop/dbsheet/cfHK6l3XR8V1/schema' --header 'X-Kso-Authorization: KSO-1 AK20250124KWLUHU:71284e376b52d41f2fee13d7b2bd4c1363dd1448646729e23bb882bcd767e48d' --header 'X-Kso-Date: Thu, 06 Feb 2025 09:48:54 GMT'
--header 'Authorization: Bearer eyJhbGciOiJFUzI1NiIsImtpZCI6IjNiNTkyYWYwLTk5ODktNDRhOC1hMzQ3LTE4Yzc1MDQ4MTlmNCIsInR5cCI6IkpXVCJ9.eyJhaWQiOjE2NzI4NDkzNTUsImF0cCI6InNwIiwiYXRzIjoiQTM3TmJieSIsImJ1aSI6ZmFsc2UsImNpZCI6NjQ2MDQ2MjM5LCJjbGkiOiJBSzIwMjUwMTI0S1dMVUhVIiwiZXhwIjoxNzM4ODQzNTE1LCJzcGkiOjE2NzI4NDkzNTV9.eTjwy7bHrRyLmMDGW6S4-HeyS73ZqmOHUfw86bzDmb9Z3g28JI6nNVUKzyVvVZjvnUo2dMv40fMfUOKia7T8dA'
--header 'contentType: application/json'

响应: { "code": 400000003, "message": "kso: PermissionDenied access_token verify err: invalid_scope {"desc":"The requested scope is invalid, unknown, or malformed. The request scopes 'kso.dbsheet.readwrite or kso.dbsheet.read' has not been granted or is not allowed to be requested."}, cause: , desc: The requested scope is invalid, unknown, or malformed. The request scopes 'kso.dbsheet.readwrite or kso.dbsheet.read' has not been granted or is not allowed to be requested., tip: "
}

您好,invalid_scope 属于鉴权不通过,请确认请求身份已申请访问对应api所需的scope。另,请勿在公共平台暴露您的access_token。

已经设置了“查询和管理多维表格”权限

如图,这两个权限都已经开通

sheet_id可以用获取schema.

没懂什么意思,是airscript脚本吗

您好,如文档'获取 Schema'所述,访问需要两个scope image.png 在开发者后台可以确认api权限开通情况,请确认用户授权下这两个权限都开通了。按您的描述只开通了'kso.dbsheet.readwrite',还需开通'kso.dbsheet.read' image.png

file_id来自云文档相关api的操作返回,来源较多 image.png

sheet_id可以通过'获取 Schema'api获取 image.png image.png

您申请的access_token是应用身份的访问令牌,应该使用用户身份

两者区别见image.png

申请用户身份方式如下 image.png