dingtalk.oapi.file.upload.chunk (上传文件块)

上传文件块

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
agent_id String 可选 123 微应用的agentId
upload_id String 可选 12 上传事务id 需要utf-8 urlEncode
chunk_sequence Number 可选 1 文件块号,从1开始计数
file byte[] 可选 1111 文件内容
支持的文件类型:

响应参数

名称 类型 示例值 描述
errmsg String ok errmsg
errcode Number 0 errcode

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/file/upload/chunk");
OapiFileUploadChunkRequest req = new OapiFileUploadChunkRequest();
req.setAgentId("123");
req.setUploadId("12");
req.setChunkSequence(1L);
req.setFile(new FileItem("/tmp/file.txt"));
OapiFileUploadChunkResponse rsp = client.execute(req, access_token);
System.out.println(rsp.getBody());

响应示例

  • JSON示例
{
    "errmsg":"ok",
    "errcode":0
}

异常示例

  • JSON示例
{
	"error_response":{
		"msg":"Remote service error",
		"code":50,
		"sub_msg":"非法参数",
		"sub_code":"isv.invalid-parameter"
	}
}

错误码解释

错误码 错误描述 解决方案

API工具

如何获得此API

FAQ

返回
顶部