上传坐席组呼入响铃
POST
https://api.itniotech.com/v3/cc/seatGroup/upload
上传坐席组呼入响铃。
请求示例
Request URL:
https://api.itniotech.com/v3/cc/seatGroup/upload
Request Method:
POST
Request Headers:
Content-Type: application/json;charset=UTF-8
Sign: 05d7a50893e22a5c4bb3216ae3396c7c
Timestamp: 1630468800
Api-Key: bDqJFiq9
Request Body:
{
"fileName":"test.mp3",
"file":"base64编码的文件内容"
}
响应示例
{
"status": "0",
"reason": "success",
"data": {
"fileName": "turnseatring-template/120250106d88d71eb084746fcb7c77a4922d82ed1.mp3",
"fileUrl":"http://xxx"
}
}
响应状态码
status |
状态说明 |
0 |
成功 |
-1 |
账号认证异常 |
-2 |
ip限制 |
-16 |
时间戳过期 |
-18 |
系统异常 |
-20 |
数据已存在 |
-21 |
数据校验异常 |
-22 |
参数异常 |
-27 |
您上传的文件格式不正确。请重新上传!(如有任何疑问,请联系客服。) |
-38 |
文件过大 |
-39 |
上传文件格式有误 |
Java-base64编码转换示例代码:
package com;
import cn.hutool.core.codec.Base64;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
public class Test {
public static void main(String[] args) {
File f = new File("c:\tmp\test.mp3");
System.out.println(file2Base64(f));
}
public static String file2Base64(File file) {
if(file==null) {
return null;
}
String base64 = null;
FileInputStream fin = null;
try {
fin = new FileInputStream(file);
byte[] buff = new byte[fin.available()];
fin.read(buff);
base64 = Base64.encode(buff);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (fin != null) {
try {
fin.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return base64;
}
}