重命名文档
... 2022-7-14 大约 1 分钟
# 重命名文档
# 接口说明
修改一篇文档的的文档名。
# 权限说明
本接口需要拥有以下任意一项权限:
scope.drive.editablescope.drive.file.metadata
# 请求格式
| 描述 | 定义 |
|---|---|
| Path | /openapi/drive/v2/files/{fileID} |
| Method | PATCH |
| Content-Type | application/x-www-form-urlencoded |
| Accept | application/json |
# 请求头部
详见Headers。
# 请求参数
# 路径参数
| 参数名 | 类型 | 必选 | 描述 |
|---|---|---|---|
| fileID | string | 是 | 文档唯一标识,详见fileID |
# 查询参数
无
# 请求体
| 参数名 | 类型 | 必选 | 描述 |
|---|---|---|---|
| title | string | 是 | 文档新标题(长度不超过36字符) |
# 响应参数
# 请求体
| 参数名 | 类型 | 描述 |
|---|---|---|
| ret | integer | 业务返回码 |
| msg | string | 业务返回码描述 |
# 请求包体
PATCH /openapi/drive/v2/files/300000000$AAAAAAAAAAAA HTTP/1.1
Host: docs.qq.com
Access-Token: ACCESS_TOKEN
Client-Id: CLIENT_ID
Open-Id: OPEN_ID
Content-Type: application/x-www-form-urlencoded
Content-Length: 10
title=test
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
# 示例
curl --location --request PATCH 'https://docs.qq.com/openapi/drive/v2/files/300000000$AAAAAAAAAAAA' \
--header 'Access-Token: ACCESS_TOKEN' \
--header 'Client-Id: CLIENT_ID' \
--header 'Open-Id: OPEN_ID' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'title=test'
1
2
3
4
5
6
2
3
4
5
6
1
2
3
4
5
6
2
3
4
5
6
# 响应包体
HTTP/1.1 200 OK
Date: Thu, 28 Jul 2022 15:34:46 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 2
Connection: keep-alive
{'ret': 0, 'msg': 'Succeed'}
1
2
3
4
5
6
7
2
3
4
5
6
7
1
2
3
4
5
6
7
2
3
4
5
6
7
# 错误码
| 错误码 | 错误说明 | 排查建议 |
|---|---|---|
| 10102 | 文件不存在 | 检查 fileID 参数是否正确,fileID 的获取方式见fileID |