语音记录查询 - nxtele/http-api-document GitHub Wiki

简要描述:

  • 语音群呼/通知/验证记录查询
  • 注意!语音通话记录中的费用计算具有一定的延迟性,每秒只能请求一次,如需获得准确费用信息请对接回执推送接口。

请求方式:

  • URL:http://api2.nxcloud.com/api/voiceSms/getVoiceCdr
  • Method:POST 参数不要传body,用form表单方式提交
  • Content-Type: application/x-www-form-urlencoded

参数:

参数名 必选 类型 说明
appkey string 语音应用appkey
secretkey string 语音应用secretkey
voiceType string 语音业务类型 0群呼, 1验证码/通知
messageid string messageid
start_time string 开始时间 格式:yyyy-MM-dd HH:mm:ss
end_time string 结束时间 格式:yyyy-MM-dd HH:mm:ss 时间跨度不能超过24小时,最多查询7天内的记录
page_size string 每页数据
page string 当前页,从1开始

请求示例:

curl --location --request POST 'http://api.nxcloud.com/api/voiceSms/getVoiceCdr' \
--data-urlencode 'appkey=asdf' \
--data-urlencode 'secretkey=qwer' \
--data-urlencode 'voiceType=1' \
--data-urlencode 'messageid=32432423' \
--data-urlencode 'start_time=2019-09-09 09:00:01' \
--data-urlencode 'end_time=2019-09-09 09:00:11' \
--data-urlencode 'page_size=10' \
--data-urlencode 'page=1'

返回示例 1.语音群呼

{
    "code": "1",
    "info": {
        "total": 1,
        "page": 1,
        "pageSize": 5,
        "rows": [
            {
                "id": 11112,
                "result": "成功接通",
                "cycle": 20,
                "time": "2019-09-09 09:00:00",
		"start_time": "2019-09-09 09:00:01",
		"end_time": "2019-09-09 09:00:20",
                "phone": "810022458",
                "basic_price": 0.005,
                "second": 19,
                "countryCode": "91",
                "messageid": 784522,
                "customer_price": 0.05,
                "show_phone": "085944247",
                "size": 1,
		"ivr_result":1
            }
        ]
    }
}

2.语音验证/通知

{
    "code": "1",
    "info": {
        "total": 1,
        "page": 1,
        "pageSize": 5,
        "rows": [
            {
                "id": 1821556,
                "result": "成功接通",
                "cycle": 1,
                "time": "2019-08-09 00:01:00",
		"start_time": "2019-09-09 09:00:01",
		"end_time": "2019-09-09 09:00:04",
                "phone": "85987053821",
                "second": 3,
                "voice_type": 2,
                "countryCode": "55",
                "messageid": 35618,
                "customer_price": 0.012,
                "show_phone": "1547822456",
                "size": 3
            }
        ]
    }
}

返回参数说明 1.语音群呼

参数名 类型 说明
code string 接口返回值 0:失败 1:成功
phone string 被叫号码
show_phone string 显示号码
countryCode string 国码
messageid string messageid
basic_price string 未通基本费
second number 秒钟数
cycle number 计费周期
size string 周期数
customer_price string 客户单价
time string 接通时间
start_time string 通话开始时间
end_time string 通话结束时间
result string 发送结果
ivr_result string 按键反馈

2.语音验证/通知

参数名 类型 说明
code string 接口返回值 0:失败 1:成功
phone string 被叫号码
show_phone string 显示号码
countryCode string 国码
messageid string messageid
second number 秒钟数
cycle number 计费周期
size string 周期数
customer_price string 客户单价
voice_type string 语音业务类型:1验证码,2通知
time string 接通时间
start_time string 通话开始时间
end_time string 通话结束时间
result string 发送结果