1. 首页
  2. 开发指南
  3. 语音机器人开放API

语音机器人开放API

接口鉴权

调用下面开放API接口时,需要在请求的Header中增加鉴权参数。

HeaderKey
AuthorizationBearer access_token

Access Token 您需要在美洽公众台【设置 / 开发者 / APIs】中获取,并设置为启用。目前 Token 的有效期是永久,重复获取将导致上次获取的 Token 失效。

curl -s https://api.meiqia.com/ -H Authorization:Bearer access_token

语音机器人-任务列表

基本信息

Path: /unified-api/datagateway/v1/call_robot/tasks/list

Method: GET

接口描述:
语音机器人-任务列表

请求参数

Headers

参数名称参数值是否必须示例备注
Content-Typeapplication/json

Query

参数名称是否必须示例备注
limit
offset

返回数据

名称类型是否必须 备注其他信息
dataobject []非必须item 类型: object
├─ answer_totalinteger必须应答数format: int64
├─ call_periodstring必须呼叫时间段
├─ called_totalinteger必须呼叫数format: int64
├─ created_atstring必须创建时间format: date-time
├─ descriptionstring必须任务描述
├─ effect_atstring必须生效时间format: date-time
├─ ent_idinteger必须format: int64
├─ expire_atstring必须过期时间format: date-time
├─ idinteger必须format: int64
├─ namestring必须任务名称
├─ out_phonesstring必须外呼号码
├─ phone_totalinteger必须号码总数format: int64
├─ redialinteger必须是否重播format: int32
├─ redial_intervalinteger必须重播间隔时长format: int64
├─ redial_timesinteger必须最大重播次数format: int32
├─ robot_numinteger必须机器人数format: int32
├─ running_descstring必须运行说明
├─ skill_idinteger必须话术模版IDformat: int64
├─ skill_nameobject必须
├─ task_statestring必须任务状态:pending:待开始|running:进行中|pausing:暂停中|finished:已完成|closed:已结束|resting:休息中
├─ updated_atstring必须更新时间format: date-time
totalinteger必须format: int64

语音机器人-外呼任务-添加号码

基本信息

Path: /unified-api/datagateway/v1/call_robot/task/add_phones

Method: POST

接口描述:
语音机器人-外呼任务-添加号码

请求参数

Headers

参数名称参数值是否必须示例备注
Content-Typeapplication/json

Body

名称类型是否必须备注其他信息
phonesobject []必须外呼号码数组item 类型: object
├─ business_idstring非必须业务ID(最长64字符)
├─ phonestring必须号码
├─ variablesmap非必须变量key为变量名称,value为变量具体内容
task_idinteger必须外呼任务ID(通过任务列表获得)format: int64

请求示例


{
    "task_id": 43,
    "phones": [
        {
            "phone": "17100001234",
            "business_id":"12345667890",
            "variables":{
                "姓名":"张三",
                "出生日期":"2023-04-03"
            }
        }
    ]
}

返回数据

名称类型是否必须备注其他信息
failure_numinteger必须format: int64
success_numinteger必须format: int64

语音机器人-通话记录列表

基本信息

Path: /unified-api/datagateway/v1/call_robot/records/list

Method: GET

接口描述:
语音机器人-通话记录列表

请求参数

Headers

参数名称参数值是否必须示例备注
Content-Typeapplication/json

Query

参数名称是否必须示例备注
task_id外呼任务ID
skill_id话术模版ID
start_at开始时间
end_at结束时间
answer_state应答状态
caller主叫号码
callee被叫号码
intent_tag意图标签
offset
limit

返回数据

名称类型是否必须备注其他信息
dataobject []必须item 类型: object
├─ Billsecinteger必须format: int64
├─ answer_atstring非必须应答时间format: date-time
├─ answer_statestring非必须应答状态:answered:正常接通|not_connected:未接通
├─ billsecstring非必须计费时长
├─ business_idstring非必须业务ID
├─ call_statestring必须呼叫状态:synthesis:待合成|pending:待开始|calling:呼叫中|called:已呼叫|timeout:已超时|replay:待重播|terminated:已终止
├─ calleestring必须被叫号码
├─ callee_attributionstring非必须被叫号码归属地
├─ callerstring必须主叫号码
├─ end_atstring必须挂机时间format: date-time
├─ idinteger必须format: int64
├─ intent_taginteger []非必须意图标签IDitem 类型: integer
├─非必须
├─ record_filestring非必须录音文件
├─ redirectstring非必须
├─ ring_timestring非必须
├─ skill_namestring必须话术模版名称
├─ start_atstring必须呼叫开始时间format: date-time
├─ task_namestring必须任务名称
├─ uuidstring必须
totalinteger必须format: int64

语音机器人-通话记录详情

基本信息

Path: /unified-api/datagateway/v1/call_robot/records/{uuid}

Method: GET

接口描述:
语音机器人-通话记录详情

请求参数

Headers

参数名称参数值是否必须示例备注
Content-Typeapplication/json

路径参数

参数名称示例备注
uuid

返回数据

名称类型是否必须备注其他信息
Billsecinteger非必须format: int64
answer_atstring非必须应答时间format: date-time
answer_statestring必须应答状态:answered:正常接通|not_connected:未接通
billsecstring非必须计费时长
business_idstring非必须业务ID
call_statestring必须呼叫状态:synthesis:待合成|pending:待开始|calling:呼叫中|called:已呼叫|timeout:已超时|replay:待重播|terminated:已终止
calleestring必须被叫号码
callee_attributionstring非必须被叫号码归属地
callerstring必须主叫号码
end_atstring必须挂机时间format: date-time
idinteger非必须format: int64
intent_taginteger []非必须意图标签IDitem 类型: integer
├─非必须
record_filestring非必须录音文件
redirectstring非必须
ring_timestring非必须
skill_namestring必须话术模版名称
start_atstring必须呼叫开始时间format: date-time
task_namestring必须任务名称
uuidstring必须
Updated on 2023年11月1日

本文是否有帮助?

您可能想了解