获取机器人配置
提供调用方获取机器人的交互配置信息。调用本接口的前提是已经在机器人平台搭建并训练了机器人。
POST
/openapi/v1/hello
content-type
application/json
请求参数:
{
"sid": "4632847230984",
"user_id": "current_user_id",
"channel": "pc"
}
参数 | 类型 | 规则 | 说明 |
---|---|---|---|
sid | string | 必填 | 会话标识。在多轮对话中[1]需使用相同的会话标识。 |
user_id | string | 必填 | 用户唯一标识。需确保该值与终端用户一一对应。 |
channel | string | 选填 | 频道标识。h5/pc/debug,默认pc |
[1]多轮对话,表示在多个对话之间保持上下文共享。使用相同的会话标识表示希望本轮对话处于多轮对话中,使用不同的会话标识则表示处于新会话。
应答结果:
{
"code":0,
"msg":"",
"result":{
"cards":[
{
"welcome":[
{
"title":"你好呀,我是你的好伙伴。",
"list":[
{
"text":"推荐问题1",
"IsDebug":false,
"type":"TextCard",
"feedback_id":null
},
{
"text":"推荐问题2",
"IsDebug":false,
"type":"TextCard",
"feedback_id":null
}],
"type":"TitleListCard",
"feedback_id":null
}],
"useful_label":"很满意",
"useful_text":"感谢您的评价,我会继续努力的。",
"useless_label":"不满意",
"useless_text":"抱歉,我会尽快更正答案。",
"feedback_useless":[
"这个不对",
"不准确"],
"bot_logo":"",
"type":"HelloCard",
"feedback_id":null
}]
}
}
返回结果为 JSON 字符串,各字段说明如下:
JSON字段 | 类型 | 说明 |
---|---|---|
code | int | 结果代码。(具体见状态码说明) |
msg | string | 详细信息,对接口请求的补充说明。 |
result | object | 结果数据。 |
result 字段说明如下:
JSON字段 | 类型 | 说明 |
---|---|---|
cards | array | 消息卡片。包含至少一条或多条消息卡片的里欸包 |
cards 字段说明如下:
JSON字段 | 类型 | 说明 |
---|---|---|
welcome | array | 欢迎语及问题推荐。 |
useful_label | string | 满意答案显示标题。 |
useful_text | string | 机器人对表示满意答案的回复语。 |
useless_label | string | 不满意答案显示标题 |
useless_text | string | 机器人对表示不满意答案的回复语。 |
feedback_useless | array | 不满意的额外补充 |
bot_logo | string | 机器人头像base64字符串 |
type | string | 卡片类型 |
welcome 说明如下
类型 | 类型 | 说明 |
---|---|---|
title | string | 欢迎语 |
list | array | 相关问题推荐 |
type | string | 卡片类型,默认TitleListCard |