机器人数据推送接口

此接口用于推送任务到第三方集成系统

请求地址

http://{第三方应用地址}/ ***/*** /

请求参数

参数 类型 说明 示例
userId string 第三方账户系统用户唯一ID  
planName string 计划名称  
planId String 外呼计划ID
happen_time long 事件发生时间
batch_count int 分批总数
batch_num int 当前批次
customers array 客户列表  
customers.[].skbId string 推送任务记录唯一ID  
customers.[].name string 联系人姓名  
customers.[].phone string 电话号码  
customers.[].companyName string 公司名称  
customers.[].url string 网址  
customers.[].callbackUrl string 回调地址  
customers.[].accessible boolean 是否实号 true为实号 false为非实号

请求方法

PUT

请求header参数

字段 类型 说明 示例
x-ak-key string 当前分销的AK值  
x-ak-ts string 毫秒级时间戳
x-ak-pin string 经过加密算法生成的加密参数

请求HTTP头信息

Content-Type: application/json

事件回调返回结果字段描述

事件回调返回数据

参数 类型 说明 示例
code string 推送结果标记 0 表示成功 1 表示失败
message string 失败消息内容  

接口调用样例

API路径
[https://{第三](https://xn--%7B-t28dk77r/)方地址}/ **/*** 此api路径为第三方回调地址路径

请求方法
PUT
Content-Type: application/json

请求Body参数
{
"userId" : "sdafssafd", #第三方系统用户唯一ID
"taskName" : "任务1", #当前任务名称
"happen_time": 1563441201133,
"customers" : [
{
"skbId" : "", #推送任务记录唯一ID
"name" : "", #联系人姓名
"phone" : "", #电话号码
"companyName" : "", #公司名称
"url" : "", #网址
"callbackUrl" : "", #回调地址
"accessible" : true, #是否是实号
},
...
]
}

 返回结果

 JSON示例
{
"code" : "0", # 0 表示成功,1表示失败
"message" : "" # 当code为1时,此为错误消息
}

 

2.任务结果汇报接口

    此接口用于第三方集成系统汇报任务执行结果

请求地址

[https://](https://xn--3d2a/)搜客宝域名/api/task/receiveRobotResult?token=${token} 这个地址来自于推送任务时,"callbackUrl"这个属性的值。

请求参数

参数 类型 说明 示例
userId string 第三方账户系统用户唯一ID  
customers array 客户列表  
customers.[].callid string 外呼id,唯一标识外呼记录的ID  
customers.[].phone_number string 呼叫号码  
customers.[].skbId string 推送任务记录唯一ID  
customers.[].record_name string 录音文件地址  
customers.[].state int 通话状态 1为接通 0为未接通
customers.[].duration int 通话时长
customers.[].start_time long 呼叫发起时间unixtimestamp 毫秒
customers.[].answerDatetime long 接听时间unixtimestamp 毫秒
customers.[].end_time long 结束时间unixtimestamp  毫秒
customers.[].conversations array 通话内容
customers.[].conversations.[].ask string 提问内容
customers.[].conversations.[].answer string 回答内容

请求方法

POST

请求HTTP头信息

Content-Type: application/json

接口调用样例

返回HTTP状态码200表示成功,否则表示失败。如果失败,请5分钟后重试。

API路径

 [https://](https://xn--3d2a/)搜客宝域名/api/task/receiveRobotResult?token=${token} 这个地址来自于推送任务时,"callbackUrl"这个属性的值。

请求方法
POST
Content-Type: application/json

请求Body参数

{
"userId" : "sdafssafd", #第三方系统用户唯一ID
"customers" : [
{
"callid" : "", #外呼id,唯一标识外呼记录的ID
"phone_number" : "", #呼叫号码
"skbId" : "", #推送任务记录唯一ID
"record_name" : "", #录音文件地址
"state" : 1, #通话状态(1为接通,0为未接通)
"duration" :180, #通话时长(秒)
"start_time" : 12323231, #呼叫发起时间unixtimestamp (毫秒)
"answerDatetime" :12323231, #接听时间unixtimestamp (毫秒)
"end_time" :12323231, #结束时间unixtimestamp (毫秒)
"conversations" : [
"ask" : "你有兴趣吗?"
"answer" : "有的"
]

},
...
]
}
文档更新时间: 2025-04-28 16:35   作者:姜河