上传文件
POST
/open-apis/drive/v1/files/upload_all
自建应用商店应用
错误码
HTTP状态码 | 错误码 | 描述 | 排查建议 |
---|---|---|---|
200 | 1061001 | internal error. | 服务内部错误,包括超时,错误码没处理。 |
400 | 1061002 | params error. | 请检查请求参数是否正确。 |
404 | 1061003 | not found. | 请确认对应资源是否存在。 |
403 | 1061004 | forbidden. | 请确认当前身份是否有对应上传节点的的权限,如用户是否有上传到指定doc的编辑权限。 |
400 | 1061021 | upload id expire. | 上传事务过期 ,请重头开始上传。 |
500 | 1061022 | file version conflict. | 文件版本号冲突。 |
400 | 1061041 | parent node has been deleted. | 请确认上传点未被删除。 |
400 | 1061042 | parent node out of limit. | 在当前上传点上传过多素材,请更换上传点。 |
400 | 1061043 | file size beyond limit. | 请检查文件长度以避免超出限制。具体限制请参考 |
400 | 1061044 | parent node not exist. | 请确认上传点是否存在。 |
200 | 1061045 | can retry. | 内部可重试错误,请稍后重试。 |
400 | 1061109 | file name cqc not passed. | 请确保上传的文件和文件名合规。 |
400 | 1061101 | file quota exceeded. | 租户容量超限,请确保租户有足够容量进行上传。 |
403 | 1061500 | mount node point kill. | 挂载点不存在。 |
400 | 1062007 | upload user not match. | 请确保当前请求身份和上传任务的身份为同一个。 |
400 | 1062008 | checksum param Invalid. | 请确保文件/文件块的checksum正确。 |
400 | 1062009 | the actual size is inconsistent with the parameter declaration size. | 实际传输的文件大小和参数说明的大小不符合一致。 |
400 | 1062010 | block missing, please upload all blocks. | 部分文件分片缺失,请确保所有文件分片上传完成。 |
400 | 1062011 | block num out of bounds. | 上传过多文件分片,请确保上传的为对应文件。 |
400 | 1061061 | user quota exceeded. | 个人容量超限,请确保个人有足够容量进行上传。 |
403 | 1061073 | no scope auth. | 没有申请接口权限。 |
200 | 1064230 | locked for data migration | 数据迁移中,暂时无法上传。 |
400 | 1062505 | parent node out of size. | 云空间单树大小超限制(40W限制 )。 |
400 | 1062506 | parent node out of depth. | 云空间目录深度超限制(15限制)。 |
400 | 1062507 | parent node out of sibling num. | 云空间目录下挂载数量超过限制(单层1500限制 )。 |
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://open.feishu.cn/open-apis/drive/v1/files/upload_all' \
--header 'Authorization;' \
--header 'Content-Type: multipart/form-data; boundary=---7MA4YWxkTrZu0gW' \
--form 'file_name="test.txt"' \
--form 'parent_type="explorer"' \
--form 'parent_node="fldcn77hdDT5"' \
--form 'size="1024"' \
--form 'file=@""'
响应示例响应示例
{
"code": 0,
"msg": "success",
"data": {
"file_token": "boxcn79yhsttjwhdDT5"
}
}
请求参数
Header 参数
Content-Type
string
必需
示例值:
multipart/form-data; boundary=---7MA4YWxkTrZu0gW
Authorization
string
必需
默认值:
Bearer {{access_token}}
Body 参数multipart/form-data
file_name
必需
示例值:
test.txt
parent_type
必需
示例值:
explorer
size
必需
示例值:
1024
checksum
可选
示例值:
123423882374238957235
file
file
必需
返回响应
修改于 2023-01-13 06:20:31