forked from nxtele/http-api-document
-
Notifications
You must be signed in to change notification settings - Fork 1
上传语音录音文件
ben.zhuang edited this page Oct 14, 2022
·
1 revision
简要描述:
- 语音群呼上传录音文件接口
请求URL:
http://api2.nxcloud.com/api/voiceSms/uploadVoiceFile
请求方式:
- POST ,使用 http form 表单提交;
- Content-Type: application/x-www-form-urlencoded
参数:
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| appkey | 是 | string | 语音应用appkey |
| secretkey | 是 | string | 语音应用secretkey |
| filename | 是 | string | 文件名称 |
| content | 是 | string | base64编码的文件内容(base64编码转换可查看最下方JAVA示例代码) |
返回示例
{
"code": "success",
"info":"http://xxxx.xxx/xxxx.mp3"
}
{
"code": "102",
"result":"当前账户或所属代理商账户已被停用"
}
返回参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| code | string | success: 请求成功,其他:请求失败 |
| info | string | 上传成功的录音文件地址 |
| result | string | 失败结果说明 |
备注
- 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\\2.m4a");
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;
}
}
Introduction
- Send Message
- Mark Incoming Message as Read
- Upload Media File
- Get Media File
- Delete Media File
- Webhook
- Query Number Information
- Query Message Template
- Create Message Template
- Edit Message Template
- Delete Message Template
- Upload Template Example File
- Embedded Page Login
- Create Client Application
- List of Phone Numbers for Client Application
- Get Verification Code
- Verify Verification Code
- Create Local Client
Short message
Voice
Call Center(NXLink)
- Web Iframe
- Manual Dial Record
- Manual Dial Record Query By orderId
- List Agent Information
- List Agent Status
- List Queue
- List Agents In Queue
- List Agent Efficiency
- Update Queue Agents
- Create AutoDial Task
- Webhook - Manual Dial
AI Agent(NXLink)
- AI Agent Task List
- Query Call Records
- Append Contacts to an Existing Task
- Delete Contacts
- Call Record Callback
Call Center(Callbot)
- Callbot API Summary
- Callbot API Authorization
- Callbot API Ping
- Create Auto Dial Task
- Add Contact List To Task
- Create Task And Add Contact
- Start Or Pause Task
- Update Task Parameters
- Get List Task
- List Call
- List Task Orders
- Stop Order
- Get Call Detail By Order
- Webhook - By Call
- Webhook - By Order
- Webhook - Task Status
Flash Call
Short links
邮件验证码
DID号码
通用
号码检测