Skip to content

获取订阅状态

根据订阅ID获取该订阅的状态

请求

项目
HTTP URLhttps://open.feishu.cn/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id
HTTP MethodGET
接口频率限制1000 次/分钟、50 次/秒
支持的应用类型custom,isv
权限要求 调用该 API 所需的权限。开启其中任意一项权限即可调用 开启任一权限即可docs:document.subscription:read 获取云文档订阅状态 drive:drive 查看、评论、编辑和管理云空间中所有文件 drive:drive:readonly 查看、评论和下载云空间中所有文件

请求头

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

路径参数

名称类型描述
file_tokenstring文档token
示例值:"doxcnxxxxxxxxxxxxxxxxxxxxxx"
subscription_idstring订阅关系ID
示例值:"1234567890987654321"

请求体

名称类型必填描述
file_typestring文档类型
示例值:"doc"
可选值有
- doc: 旧版文档 - docx: 新版文档 - wiki: 云空间

请求体示例

json
{"file_type":"docx"}

响应

响应体

名称类型描述
codeint错误码,非 0 表示失败
msgstring错误描述
data\--
  └ subscription_idstring订阅关系ID
  └ subscription_typestring订阅类型
可选值有
- comment_update: 评论更新
  └ is_subcribeboolean是否订阅
  └ file_typestring文档类型
可选值有
- doc: 旧版文档 - docx: 新版文档 - wiki: 知识库

响应体示例

json
{
    "code": 0,
    "data": {
        "file_type": "docx",
        "is_subcribe": false,
        "subscription_id": "xxxxxxxx",
        "subscription_type": "comment_update"
    },
    "msg": "success"
}

错误码

HTTP状态码错误码描述排查建议
4001064000Illegal parameter检查参数有效性
4031064030Permission denied检查文档权限,订阅评论至少需要阅读的权限
4041064040Token not exist检查文档是否能正常访问
5001065000Internal Server Error重试,若稳定失败请联系相关业务方oncall人员

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