分片上传文件(预上传)
POST
/open-apis/drive/v1/files/upload_prepare
自建应用商店应用
你在24小时内可保存上传事务ID和上传进度,以便可以恢复上传
该接口不支持太高的并发,且调用频率上限为5QPS
错误码
HTTP状态码 | 错误码 | 描述 | 排查建议 |
---|---|---|---|
200 | 1061001 | internal error. | 服务内部错误,包括超时,错误码没处理。 |
400 | 1061002 | params error. | 请检查请求参数是否正确。 |
403 | 1061004 | forbidden. | 请确认当前身份是否有对应上传节点的的权限,如用户是否有上传到指定doc的编辑权限。 |
500 | 1061022 | file version conflict. | 文件版本号冲突。 |
400 | 1061043 | file size beyond limit. | 请检查文件长度以避免超出限制。具体限制请参考 |
400 | 1061044 | parent node not exist. | 请确认上传点是否存在。 |
400 | 1061109 | file name cqc not passed. | 请确保上传的文件和文件名合规。 |
400 | 1061101 | file quota exceeded. | 租户容量超限,请确保租户有足够容量进行上传。 |
400 | 1061061 | user quota exceeded. | 个人容量超限,请确保个人有足够容量进行上传。 |
403 | 1061073 | no scope auth. | 没有申请接口权限。 |
200 | 1064230 | locked for data migration | 数据迁移中,暂时无法上传。 |
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://open.feishu.cn/open-apis/drive/v1/files/upload_prepare' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
"file_name": "test.txt",
"parent_type": "explorer",
"parent_node": "fldcnaBcdEfghdis",
"size": 1024
}'
响应示例响应示例
{
"code": 0,
"msg": "success",
"data": {
"upload_id": "7111211691345512356",
"block_size": 4194304,
"block_num": 1
}
}
请求参数
Header 参数
Authorization
string
必需
默认值:
Bearer {{access_token}}
Content-Type
string
必需
默认值:
application/json; charset=utf-8
Body 参数application/json
返回响应
修改于 2023-01-13 06:17:32