接口调用说明
支持在 App 后台主动调用 REST API 接口,获取机器人寒暄库分类列表。
请求 URL 示例
https://xxxxxx/v4/openim_console_http_svc/desc_chitchat_category?sdkappid=88888888&identifier=admin&usersig=xxx&random=99999999&contenttype=json
请求参数说明
参数 | 说明 |
v4/openim_console_http_svc/desc_chitchat_category | 请求接口。 |
sdkappid | 创建应用时即时通信 IM 控制台分配的 SDKAppID。 |
identifier | |
usersig | |
random | 请输入随机的32位无符号整数,取值范围0 - 4294967295。 |
contenttype | 请求格式固定值为 json 。 |
最高调用频率
5次/秒。
请求包示例
{}
说明:
请求包体填空的 JSON 结构即可。
应答包体示例
{"ActionStatus": "OK","ErrorInfo": "","ErrorCode": 0,"Total": 8,"List": [{"CategoryId": 10506,"ParentId": 0,"Title": "系统预设分类","MenuType": 2,"Status": 1},{"CategoryId": 10507,"ParentId": 0,"Title": "全部分类","MenuType": 1,"Status": 1},{"CategoryId": 10508,"ParentId": 10506,"Title": "日常问候","MenuType": 2,"Status": 1},{"CategoryId": 10509,"ParentId": 10506,"Title": "询问机器人信息","MenuType": 2,"Status": 1},{"CategoryId": 10510,"ParentId": 10506,"Title": "情绪表达","MenuType": 2,"Status": 1},{"CategoryId": 10511,"ParentId": 10506,"Title": "兴趣爱好","MenuType": 2,"Status": 1},{"CategoryId": 10512,"ParentId": 10506,"Title": "客服场景问答","MenuType": 2,"Status": 1},{"CategoryId": 10513,"ParentId": 0,"Title": "寒暄库分类更新","MenuType": 0,"Status": 1}]}
应答包字段说明
字段 | 类型 | 说明 |
ActionStatus | String | 请求处理的结果,OK 表示处理成功,FAIL 表示失败。 |
ErrorCode | Integer | 错误码,0表示成功,非0表示失败。 |
ErrorInfo | String | 错误信息。 |
Total | String | 总分类数量。 |
List | Array | 分类列表。 |
CategoryId | Integer | 分类唯一 ID。 |
ParentId | Integer | 父级分类ID。当分类为二级分类时,此值不为 0,且指向父级分类 ID。 |
MenuType | Integer | 分类类型: 0:普通分类。 1:代表全部分类。 2:代表预设预设分类。 |
Status | Integer | 分类状态: 1:启用。 |
错误码说明
除非发生网络错误(例如502错误),否则该接口的 HTTP 返回码均为200。真正的错误码,错误信息是通过应答包体中的 ErrorCode、ErrorInfo 来表示的。
本 API 私有错误码如下:
错误码 | 描述 |
-7 | 参数解析失败,请检查请求包是否符合 JSON 规范或者请求参数符合要求。 |
-14 | 超过该接口允许的最大频率限制。 |
-20 | 请求需要 App 管理员权限。 |