上传语音文件_v1 - nxtele/http-api-document GitHub Wiki
上传语音文件
- URL:
https://api.nxcloud.com/v1/voice/uploadFile
- Method:
POST
- Content-Type:
application/json
- 需要鉴权:
是
鉴权规则请参考地址:API接口调用约定
参数名 | 类型 | 必选 | 示例值 | 说明 |
---|---|---|---|---|
accessKey | String | 是 | fmexxx3ki | 用户身份标识 |
ts | String | 是 | 1655710885431 | 当前请求的时间戳(单位是毫秒),牛信服务端允许用户端请求最大时间误差为60秒 |
bizType | String | 是 | 8 | 业务类型,取固定值“7” |
action | String | 是 | upload | 业务操作,取固定值“upload” |
sign | String | 是 | 6e95xxx826 | API入参参数签名,签名算法 |
参数名 | 类型 | 必选 | 说明 |
---|---|---|---|
appkey | String | 是 | 语音应用appkey |
file | File | 是 | 语音文件 |
参数名 | 类型 | 说明 |
---|---|---|
code | String | 结果编码,参照响应码说明 |
message | String | 结构 |
data | String | 返回文件URL |
traceId | String | 跟踪ID |
成功示例
{
"code": 0,
"message": "Success",
"data": "https://nxcloudhk.oss-cn-hongkong.aliyuncs.com/voice_group/1699931848093.m4a",
"traceId": "1e7532bc7fb642ac9c8feb1156999f47"
}
失败示例
{
"code": 9003,
"message": "Customer APP does not exist / Status is unavailable",
"traceId": "246f112ef3104466b82772f131b26724"
}
code | 说明 |
---|---|
0 | 请求成功 |
1000~10XX | 详情参照API鉴权常见错误码 |
9000 | Request parameter error |
9003 | Customer APP does not exist / Status is unavailable |
15001 | file exceed 2MB |
15002 | file upload fail |