Upload Incoming Ring of Agent Group
POST
https://api.itniotech.com/v3/cc/seatGroup/upload
Upload incoming ring of agent group.
Request Sample
copy
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 encoded file content"
}
Response Sample
copy
{
"status": "0",
"reason": "success",
"data": {
"fileName": "turnseatring-template/120250106d88d71eb084746fcb7c77a4922d82ed1.mp3",
"fileUrl":"http://xxx"
}
}
Response Status Code
status
Description
0
Success
-1
Authentication error
-2
Authentication error
-16
Timestamp expires
-18
Port program unusual
-20
Data existing
-21
Data validation exception
-22
Parameter exception
-27
The format of the file you uploaded is incorrect. Please upload again! (Contact customer service if you have any questions.)
-38
File too large
-39
The uploaded file format is incorrect
Java-base64 Encoding Conversion Example Code:
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;
}
}