简要描述:
对话接口
接口版本:
| 版本号 | 制定人 | 制定日期 | 修订日期 |
|---|---|---|---|
| 1.0 | 王力 | 2019-04-25 | 2019-04-25 |
接口说明:
| 请求方式 | 接口地址 | Content-Type |
|---|---|---|
| POST | /dialog | none |
请求参数说明:
| 名称 | 提交 | 必填 | 数据类型 | 参数说明 |
|---|---|---|---|---|
| customerId | json | Y | String | 用户ID |
| appKey | json | Y | String | 机器人密钥 |
| text | json | Y | String | 用户说 |
| sessionId | json | N | String | 会话ID |
| chatId | json | N | String | 聊天ID |
| channel | json | N | String | 通道:微信,Web,小程序 |
| matchingIntentId | json | N | String | 客户端ID |
请求参数示例:
{
"text": "你好啊",
"customerId": "1234",
"appKey": "fb988a2a-1c06-4cbd-a22f-68e924bfc61d",
"sessionId": "1234",
"chatId": "1234",
"channel": "1234",
"matchingIntentId": "1234"
}返回参数说明:
| 参数名 | 必填 | 类型 | 说明 |
|---|---|---|---|
| errorCode | 是 | int | 错误码(0表示成功) |
| errorMsg | 是 | string | 描述信息 |
| response | 是 | 对象 | 机器答内容,内容参考数据设置表DialogModel |
返回示例:
正确时返回
{
"response": {
"intents": [
{
"score": "0",
"scoreColor": "c1",
"action": "dialog",
"id": "default-intent-id",
"outputs": [
{
"type": "dialog",
"property": {
"text": "可爱的小朋友,你下午学习了吗? ",
"emotion": "suspect"
}
},
{
"type": "wechat.text",
"property": {
"text": "可爱的小朋友,你下午学习了吗? "
}
}
],
"result": {
"text": "可爱的小朋友,你下午学习了吗? ",
"type": "dialog"
}
}
],
"_text": "你好啊",
"meta_process_milliseconds": 130,
"msg_id": "abe0642c-985b-4c89-bb01-210914ce6dc5"
},
"errorMsg": "请求成功",
"errorCode": 0
}错误时返回
{
"errorCode": 100,
"errorMsg": "系统错误"
}备注:
- 更多返回错误代码请看首页的错误代码描述
文档更新时间: 2019-04-25 16:32 作者:彭湃