文件下载
接口说明
文件下载,客户在收到回调时可以根据回调的参数进行文件下载。
文件下载
接口名 |
channel/downloadFile |
接口描述 |
文件下载 |
data输入参数
参数名称 |
类型 |
必填 |
说明 |
filedId |
String |
是 |
使用结果通知返回的filedId |
signuuid |
String |
是 |
使用结果通知返回的uuid |
返回参数
参数名称 |
类型 |
必填 |
说明 |
fileBase64Str |
String |
是 |
文件base64数据 |
fileExt |
String |
是 |
文件扩展名 |
fileName |
String |
是 |
文件名 |
JAVA调用实例
String methodUrl = "channel/downloadFile";
String filedId = "XXXX";
String signuuid = "XXXX";
String url="xxx";
String appId="";
String appSecret="";
Map<String, Object> params = new HashMap<String, Object>();
params.put("filedId", filedId);
params.put("signuuid", signuuid);
String data = JSONObject.toJSONString(params);
Map channelContext = MessageUtil.getChannelContext(appId,
appSecret, data, null);
String rpcResult = HttpsClientUtil.getInstance().httpsPost(
url+"/api/v1/" + methodUrl,
JSONObject.toJSONString(channelContext));
System.out.println("返回结果:"+rpcResult);