| 限定符和类型 | 方法和说明 |
|---|---|
CreateFileResp |
create(CreateFileReq req)
上传文件,上传文件,可以上传视频,音频和常见的文件类型。
|
CreateFileResp |
create(CreateFileReq req,
RequestOptions reqOptions)
上传文件,上传文件,可以上传视频,音频和常见的文件类型。
|
GetFileResp |
get(GetFileReq req)
下载文件,下载文件接口,只能下载应用自己上传的文件。
|
GetFileResp |
get(GetFileReq req,
RequestOptions reqOptions)
下载文件,下载文件接口,只能下载应用自己上传的文件。
|
public File(Config config)
public CreateFileResp create(CreateFileReq req, RequestOptions reqOptions) throws Exception
注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 文件大小不得超过30M,且不允许上传空文件 ;
官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/file/create ;
Exceptionpublic CreateFileResp create(CreateFileReq req) throws Exception
注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 文件大小不得超过30M,且不允许上传空文件 ;
官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/file/create ;
Exceptionpublic GetFileResp get(GetFileReq req, RequestOptions reqOptions) throws Exception
注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 只能下载机器人自己上传的文件;- 下载用户发送的资源,请使用[获取消息中的资源文件](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-resource/get)接口;- 下载的资源大小不能超过100M;- 如果需要Content-Disposition header,发起请求的时候需要在header中设置Content-Type为application/json ;
官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/file/get ;
Exceptionpublic GetFileResp get(GetFileReq req) throws Exception
注意事项:;- 需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability);- 只能下载机器人自己上传的文件;- 下载用户发送的资源,请使用[获取消息中的资源文件](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/message-resource/get)接口;- 下载的资源大小不能超过100M;- 如果需要Content-Disposition header,发起请求的时候需要在header中设置Content-Type为application/json ;
官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/file/get ;
ExceptionCopyright © 2022. All rights reserved.