开发者文档 开发者文档
帮助中心 (opens new window)
帮助中心 (opens new window)
  • 渠道接入

    • Web 链接接入说明
    • Web-JS 接入说明
    • Android SDK
    • Android SDK V6
    • iOS SDK
    • iOS SDK V6
    • 微信小程序
    • 微信公众号
    • 企业微信
    • 微博私信
    • Flutter、DCloud、APICloud
    • 微信客服
    • CRM 对接方案
  • 在线客服 API
  • 在线统计 API
  • 在线机器人 API
  • 知识库 API
  • 电商平台 API
  • 客服组件SDK

  • 消息推送
  • 在线消息转发 API
  • 知识库V6 API
    • 在线机器人统计 API
    • 企业主动发送离线消息API
    • 规则引擎API
    • 大模型机器人API
    • 文本类产品 API
    智齿科技
    2022-09-01
    目录

    知识库V6 API

    # 知识库 V6

    # 接口声明

    在调用接口时必须在 https 请求的 header 中携带 "token" 参数。

    Token 是智齿客服接口开放平台全局唯一的接口调用凭据。 开发者在调用各业务接口时都需使用 Token,开发者需要进行妥善保存。 Token 的存储至少要保留 32 个字符空间。Token 的有效期目前为 24 个小时,需定时刷新,或根据接口返回的 Token 失效提示,进行重新获取。请求 Token 接口,无论 Token 是否存在,都会返回新的 Token,并重置 Token 的过期时间(目前 24 小时)。

    Token 使用方式说明: 1、开发者需要统一获取和管理 Token,在调用智齿客服各个业务开放接口时都应该使用同一个的 Token,不应该每个业务都刷新获取新的 Token,否则容易导致 Token 失效,影响接口的正常调用; 2、目前 Token 的有效期通过返回的 expire_in 来传达,目前是 86,400 秒之内的值。开发者需要根据这个有效时间提前去刷新新 Token。 3、开发者需要根据接口返回的 Token 失效提示,进行重新获取 Token。

    # 接口调用

    # ● 获取访问 Token 编码

    接口说明:

    获取 API 开放接口 Token,此 Token 仅适用于智齿开放平台 5.0 版本全部 API 接口 。API 接口中的参数 appid 、 app_key 请联系智齿售后人员获取。

    请求方式:

    GET

    请求地址:

     https://api-a.sobot.com/api/get_token
    
    1

    请求参数:

    参数 类型 必填 描述
    appid String 是 接口凭证 Id,第三方用户接口调用唯一凭证 id
    create_time String 是 10位数时间戳
    sign String 是 签名 md5(appid+create_time+app_key)

    返回参数:

    参数 类型 必填 描述
    ret_code String 是 返回编码
    ret_msg String 是 返回信息
    item Object 否 返回对象

    item 对象:

    参数 类型 必填 描述
    token String 是 token 编码
    expires_in String 是 凭证有效时间,单位:秒

    时间戳转换参考工具:

    http://tool.chinaz.com/Tools/unixtime.aspx
    
    1

    sign 签名生成示例:

    例如,appid = "1"; create_time="1569397773"; app_key="2"

    sign = Md5("115693977732") 为 258eec3118705112b2c53dc8043d4d34。

    请求示例:

    curl https://api-a.sobot.com/api/get_token?appid=1&create_time=1569397773&sign=258eec3118705112b2c53dc8043d4d34
    
    1

    返回示例:

    {
        "item": {
            "token": "4ac37cb2e9c740dba4b75a34d5358802",
            "expires_in": "86400"
        },
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    # ● 查询知识库词条列表

    接口说明:

    接口类型:主动调用接口

    接口作用:可通过调用该接口来查询某个知识库所有知识条目的列表

    请求方式:

    POST

    请求地址:

     https://api-a.sobot.com/open/robot/v6/new_single/search_doc_list
    
    1

    headers 请求头:

    参数 类型 必填 描述
    language String 否 语言标识:en-英文,zh-中文(默认中文)

    请求参数:

    参数 类型 必填 描述
    key_flag String 是 1标准问题,3答案
    question_typeid String 是 词条类型(传-1)
    kbids List 是 所属知识库 int类型集合
    page_no String 是 当前页码
    page_size String 是 分页条数
    key_words List 否 搜索关键字 string类型集合
    used_flag String 否 词条状态,0-启用,1-手动停用,2-系统停用,3-过期停用
    link_flag String 否 是否有关联问题,0-是,1-否
    createid String 否 词条创建人 id
    create_start_date String 否 创建开始时间
    create_end_date String 否 创建结束时间
    updateid String 否 词条最后更新人
    update_start_date String 否 更新开始时间
    update_end_date String 否 更新结束时间
    effect_start_date String 否 生效开始时间
    effect_end_date String 否 生效结束时间
    invalid_start_date String 否 失效开始时间
    invalid_end_date String 否 失效结束时间
    is_draft String 否 是否草稿 0否 1是 为空则全部

    返回参数:

    参数 类型 必填 描述
    ret_code String 返回编码
    ret_msg String 返回信息
    items Object 返回对象
    page_count String 总页数
    page_no String 当前页码
    page_size String 每页条数
    total_count String 总条数

    items 对象:

    参数 类型 必填 描述
    audit_status String 审核状态:0-待审核,1-永久有效,2-指定时间有效
    companyid String 公司 id
    docid String 词条 id
    questionid String 问题 id
    effect_time String 生效时间
    create_time String 创建时间
    invalid_time String 失效时间
    link_flag String 是否有关联问题,0-是,1-无
    match_flag String 匹配模式:0-智能匹配,1-完全匹配,2-包含匹配,3-欢迎语匹配
    questionid String 问题 ID
    question_title String 问题标题
    question_typeid String 问题类型 ID
    question_type_name String 问题类型名
    kbid String 知识库所属机器人:0-公共知识库,1-机器人一
    smail_question_num String 相似问法个数
    updateid String 更新人 id
    update_time String 更新时间
    used_flag String 词条状态,0-启用,1-手动停用,2-系统停用,3-过期停用,-2:隐藏状态
    answer_list List 答案

    answer_list对象:

    参数 类型 必填 描述
    answerid String 答案id
    answer_desc String 答案内容
    answer_img String 缩略图
    answer_summary String 摘要
    answer_txt String 答案纯文本信息
    file_size String 文件大小
    msg_type String 答案类型:-1富文本7小程序

    请求示例:

    curl https://api-a.sobot.com/open/robot/v6/new_single/search_doc_list
    -X POST
    -H 'token: xxxxxxxxxxxxxxxxxxxxxxxxx' 
    -H 'Content-Type: application/json' 
    -H 'language: zh'
    -d '{
        "key_words":["不吵架"],
        "key_flag":1,
        "page_no": "1",
    	"page_size": "15"
    }'
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11

    返回示例:

    {
        "total_count": 2,
        "page_no": 1,
        "ret_msg": "操作成功",
        "ret_code": "000000",
        "items": [
            {
                "kbid": 39,
                "match_flag": 0,
                "linked_list": [],
                "docid": "5bb788ee7a0a4f3aa42494bd85a63925",
                "link_question_list": [],
                "rule_list": [
                    {
                        "rule_answer_list": []
                    }
                ],
                "audit_status": 1,
                "smail_question_list": [],
                "question_title": "不吵架但是不付出就会的",
                "question_typeid": "dd92ec4c6ba2411bb316c972d6bdbdf6",
                "is_experience": 0,
                "smail_question_num": 0,
                "update_time": "2022-07-29 19:57:06",
                "answer_type": 1,
                "answer_list": [
                    {
                        "msg_flag": 0,
                        "answer_desc": "<p>从不觉得还是把吹风机的呢我</p>",
                        "msg_type": -1,
                        "answer_txt": "从不觉得还是把吹风机的呢我",
                        "answer_summary": "从不觉得还是把吹风机的呢我"
                    }
                ],
                "question_type_name": "好的表达",
                "invalid_time": "2099-12-31 23:59:59",
                "update_service_name": "baimingdan",
                "used_flag": 0,
                "effect_time": "2022-07-29 00:00:00"
            },
            {
                "kbid": 39,
                "match_flag": 0,
                "linked_list": [],
                "docid": "493733a7228146159baa7a35834d218d",
                "link_question_list": [],
                "rule_list": [
                    {
                        "rule_answer_list": []
                    }
                ],
                "audit_status": 1,
                "smail_question_list": [],
                "question_title": "改不吵架但是不能吃健康的身材",
                "question_typeid": "dd92ec4c6ba2411bb316c972d6bdbdf6",
                "is_experience": 0,
                "smail_question_num": 0,
                "update_time": "2022-07-29 20:01:47",
                "answer_type": 1,
                "answer_list": [
                    {
                        "msg_flag": 0,
                        "answer_desc": "<p>v标点符号就是不成v几点上课方式</p>",
                        "msg_type": -1,
                        "answer_txt": "v标点符号就是不成v几点上课方式",
                        "answer_summary": "v标点符号就是不成v几点上课方式"
                    }
                ],
                "question_type_name": "好的表达",
                "invalid_time": "2099-12-31 23:59:59",
                "update_service_name": "baimingdan",
                "used_flag": 0,
                "effect_time": "2022-07-29 00:00:00"
            }
        ],
        "page_count": 1,
        "page_size": 10
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    # ● 查询知识库分类列表

    接口说明:

    接口类型:主动调用接口

    接口作用:可通过调用该接口来查询某个知识库中的分类

    请求方式:

    POST

    请求地址:

    https://api-a.sobot.com/open/robot/v6/new_single/get_kb_list
    
    1

    headers 请求头:

    参数 类型 必填 描述
    language String 否 语言标识:en-英文,zh-中文(默认中文)

    请求参数:

    参数 类型 必填 描述
    robot_flag String 是 知识库所属机器人:1-机器人一
    kbid String 否 知识库id

    返回参数:

    参数 类型 必填 描述
    ret_code String 是 返回编码
    ret_msg String 是 返回信息
    items Object 否 返回对象

    items 对象:

    参数 类型 必填 描述
    id String type=1知识库id type=2问题分类id
    kbid String 知识库id
    name String 知识库名称
    type String 1知识库 2问题分类
    parent_typeid String 父级分类id
    question_type_desc String 问题分类描述
    question_typeid String 问题分类id
    question_type_name String 问题分类名称
    child_type_list List 子级,同父级结构相同

    请求示例:

    curl https://api-a.sobot.com/open/robot/v6/new_single/get_kb_list
    -X POST
    -H 'token: xxxxxxxxxxxxxxxxxxxxxxxxx' 
    -H 'Content-Type: application/json' 
    -H 'language: zh'
    -d '{
        "robot_flag":"1"
    }'
    
    1
    2
    3
    4
    5
    6
    7
    8

    返回示例:

    {
        "ret_msg": "操作成功",
        "ret_code": "000000",
        "items": [
            {
                "kbid": 10,
                "name": "默认知识库10",
                "child_type_list": [
                    {
                        "question_type_desc": "一级分类",
                        "question_type_name": "333",
                        "name": "333",
                        "parent_typeid": "-1",
                        "child_type_list": [],
                        "id": "cbf5d929019b4e3fb50dc06ff9a36b29",
                        "type": 2,
                        "question_typeid": "cbf5d929019b4e3fb50dc06ff9a36b29"
                    },
                    {
                        "question_type_desc": "一级分类",
                        "question_type_name": "213",
                        "name": "213",
                        "parent_typeid": "-1",
                        "child_type_list": [],
                        "id": "b33bd779f8fc44c6aa98fe79d464115f",
                        "type": 2,
                        "question_typeid": "b33bd779f8fc44c6aa98fe79d464115f"
                    },
                    {
                        "question_type_desc": "一级分类",
                        "question_type_name": "默认分类",
                        "name": "默认分类",
                        "parent_typeid": "-1",
                        "child_type_list": [
                            {
                                "question_type_desc": "二级分类",
                                "question_type_name": "2212",
                                "name": "2212",
                                "parent_typeid": "536f9e5794c340f39f7e2e2567117780",
                                "child_type_list": [],
                                "id": "26daee4e54b045e0a0ebf5f97c5a179a",
                                "type": 2,
                                "question_typeid": "26daee4e54b045e0a0ebf5f97c5a179a"
                            }
                        ],
                        "id": "536f9e5794c340f39f7e2e2567117780",
                        "type": 2,
                        "question_typeid": "536f9e5794c340f39f7e2e2567117780"
                    }
                ],
                "id": "79307a3786c94313b14196fa096f4845",
                "type": 1
            },
            {
                "kbid": 36,
                "name": "公共知识库36",
                "child_type_list": [],
                "id": "48ac199888c04a7f92d5db1990214c0e",
                "type": 1
            },
            {
                "kbid": 39,
                "name": "新建知识库39",
                "child_type_list": [
                    {
                        "question_type_desc": "一级分类",
                        "question_type_name": "好的表达",
                        "name": "好的表达",
                        "parent_typeid": "-1",
                        "child_type_list": [
                            {
                                "question_type_desc": "二级分类",
                                "question_type_name": "都不想和进步的",
                                "name": "都不想和进步的",
                                "parent_typeid": "dd92ec4c6ba2411bb316c972d6bdbdf6",
                                "child_type_list": [],
                                "id": "c186ae1deffd43d1b26ffe793e4eb569",
                                "type": 2,
                                "question_typeid": "c186ae1deffd43d1b26ffe793e4eb569"
                            }
                        ],
                        "id": "dd92ec4c6ba2411bb316c972d6bdbdf6",
                        "type": 2,
                        "question_typeid": "dd92ec4c6ba2411bb316c972d6bdbdf6"
                    }
                ],
                "id": "ee736f20c7b24aa0aefe17888dd0e592",
                "type": 1
            },
            {
                "kbid": 41,
                "name": "测试删除41",
                "child_type_list": [
                    {
                        "question_type_desc": "一级分类",
                        "question_type_name": "12121211212",
                        "name": "12121211212",
                        "parent_typeid": "-1",
                        "child_type_list": [],
                        "id": "5572ede5bec348fc951f80f8ab0967c9",
                        "type": 2,
                        "question_typeid": "5572ede5bec348fc951f80f8ab0967c9"
                    }
                ],
                "id": "f9532c3c2ed34e9fb8d5781b692ff3ba",
                "type": 1
            },
            {
                "kbid": 43,
                "name": "genglu43",
                "child_type_list": [],
                "id": "94abc19b81134afdbe212f8fa7978cc1",
                "type": 1
            },
            {
                "kbid": 44,
                "name": "这是新的不能再新的库445",
                "child_type_list": [],
                "id": "0d871b87ed1b4de7b1cb83923b96b021",
                "type": 1
            },
            {
                "kbid": 45,
                "name": "知识库45请求12aqw",
                "child_type_list": [
                    {
                        "question_type_desc": "一级分类",
                        "question_type_name": "默认分类",
                        "name": "默认分类",
                        "parent_typeid": "-1",
                        "child_type_list": [],
                        "id": "8589d0dde56b47038bf8bd92da8e89a1",
                        "type": 2,
                        "question_typeid": "8589d0dde56b47038bf8bd92da8e89a1"
                    }
                ],
                "id": "37246310bcb94791bc67eb4d0e980d60",
                "type": 1
            }
        ]
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    # ● 查询知识库词条

    接口说明:

    接口类型:主动调用接口

    接口作用:可通过调用该接口来查询某个知识条目的详细信息

    请求方式:

    POST

    请求地址:

    https://api-a.sobot.com/open/robot/v6/new_single/doc_info
    
    1

    headers 请求头:

    参数 类型 必填 描述
    language String 否 语言标识:en-英文,zh-中文(默认中文)

    请求参数:

    参数 类型 必填 描述
    docid String 是 词条 id

    返回参数:

    参数 类型 必填 描述
    ret_code String 是 返回编码
    ret_msg String 是 返回信息
    item Object 否 返回对象

    item 对象:

    参数 类型 必填 描述
    audit_status String 审核状态:0-待审核,1-永久有效,2-指定时间有效
    companyid String 公司 id
    docid String 词条 id
    effect_time String 生效时间
    invalid_time String 失效时间
    link_flag String 是否有关联问题,0-是,1-无
    match_flag String 匹配模式:0-智能匹配,1-完全匹配,2-包含匹配,3-欢迎语匹配
    questionid String 问题 ID
    question_title String 问题标题
    question_typeid String 问题类型 ID
    question_type_name String 问题类型名
    kbid String 知识库所属机器人:0-公共知识库,1-机器人一
    smail_question_num String 相似问法个数
    update_service_name String 更新人
    update_time String 更新时间
    used_flag String 词条状态,0-启用,1-手动停用,2-系统停用,3-过期停用,-2:隐藏状态
    answer_list List 答案
    link_question_list List 关联问题
    smail_question_list List 相似问 字符串类型集合

    answer_list对象:

    参数 类型 必填 描述
    answerid String 答案id
    answer_desc String 答案内容
    answer_img String 缩略图
    answer_summary String 摘要
    answer_txt String 答案纯文本信息
    file_size String 文件大小
    msg_type String 答案类型:-1富文本7小程序

    link_question_list对象:

    参数 类型 必填 描述
    docid String 关联问题词条 id
    link_name String 关联问题名称
    link_question_title String 关联词条的标准问题

    请求示例:

    curl https://api-a.sobot.com/open/robot/v6/new_single/doc_info
    -X POST
    -H 'token: xxxxxxxxxxxxxxxxxxxxxxxxx' 
    -H 'Content-Type: application/json' 
    -H 'language: zh'
    -d '{
        "docid":"7ec94257f97b42fa8ebab7839b960b9e"
    }'
    
    1
    2
    3
    4
    5
    6
    7
    8

    返回示例:

    {
        "item": {
            "kbid": 10,
            "match_flag": 0,
            "linked_list": [],
            "docid": "7ec94257f97b42fa8ebab7839b960b9e",
            "link_question_list": [],
            "rule_list": [
                {
                    "rule_answer_list": []
                }
            ],
            "audit_status": 1,
            "smail_question_list": [],
            "question_title": "默认知识库10的标准答案",
            "question_typeid": "cbf5d929019b4e3fb50dc06ff9a36b29",
            "m_linked_list": [],
            "smail_question_num": 0,
            "update_time": "2022-08-29 16:11:07",
            "answer_type": 1,
            "answer_list": [
                {
                    "msg_flag": 0,
                    "answer_desc": "<p>这是小哦爱下一</p><p></p><div class=\"media-wrap image-wrap\"><img class=\"media-wrap image-wrap\" src=\"https://sobot-test.oss-cn-beijing.aliyuncs.com/console/624f6b0bdcad4559bba55758b851f2e8/common/2b59f77d3cb1701e94e74816ca999a58_1661759493840.jpg\"/></div>",
                    "msg_type": -1,
                    "answer_txt": "这是小哦爱下一",
                    "answer_summary": "这是小哦爱下一a"
                },
                {
                    "msg_flag": 0,
                    "answer_desc": "<p><br></p><p><img src=\"https://sobot-test.oss-cn-beijing.aliyuncs.com/console/624f6b0bdcad4559bba55758b851f2e8/common/波妞_1661760663750.png\" alt=\"\" data-href=\"\" style=\"\"/></p>",
                    "msg_type": -1,
                    "answer_txt": "",
                    "answer_summary": "a"
                },
                {
                    "msg_flag": 0,
                    "answer_desc": {
                        "cover_url": "https://img.sobot.com/kb-center-service/discovery/624f6b0bdcad4559bba55758b851f2e8/2022-08-29/09802e950869450ebc3a1c43696ac197.jpg",
                        "id": "chewud",
                        "page": "dhiuewhnde.html",
                        "title": "cbsjdkne"
                    },
                    "msg_type": 7
                }
            ],
            "question_type_name": "333",
            "invalid_time": "2099-12-31 23:59:59",
            "update_service_name": "baimingdan",
            "used_flag": 0,
            "effect_time": "2022-08-29 00:00:00"
        },
        "ret_msg": "操作成功",
        "ret_code": "000000",
        "items": []
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    # ● 查询相似问题

    请求方式:

    POST

    请求地址:

    https://api-a.sobot.com/open/robot/v6/new_single/query_doc_similar_list
    
    1

    headers 请求头:

    参数 类型 必填 描述
    language String 否 语言标识:en-英文,zh-中文(默认中文)

    请求参数:

    参数 类型 必填 描述
    kbids List 是 所属知识库 int类型集合
    key_words List 否 搜索关键字 String类型集合
    page_no Integer 是 当前页码
    page_size Integer 是 分页条数

    返回参数:

    参数 类型 必填 描述
    ret_code String 是 返回编码
    ret_msg String 是 返回信息
    page_no Integer 是 页码
    page_count Integer 是 页数
    total_count String 是 总量
    page_size String 是 页面容量
    items Object 否 返回对象

    items 对象

    参数 类型 必填 描述
    docid String 词条 id
    quection_title String 问法标题
    questionid String 问题id
    create_serviceid String 创建者 id
    create_service_name String 创建者名
    create_time Long 创建时间
    update_serviceid String 修改者 id
    update_service_name String 修改者名
    update_time Long 修改时间
    kbid Integer 所属知识库

    请求示例:

    curl https://api-a.sobot.com/open/robot/v6/new_single/query_doc_similar_list
    -X POST
    -H 'token: xxxxxxxxxxxxxxxxxxxxxxxxx' 
    -H 'Content-Type: application/json' 
    -H 'language: zh'
    -d '{
        "key_words":[],
        "kbids":[],
        "page_no": "1",
    	"page_size": "15"
    }'
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11

    返回示例:

    {
        "total_count": 68,
        "page_no": 1,
        "ret_msg": "操作成功",
        "ret_code": "000000",
        "items": [
            {
                "kbid": 39,
                "update_serviceid": "76b5a705f2254ed3b1a356e2b50cef70",
                "update_time": "2022-08-19 18:43:12",
                "questionid": "b6697093312a41989f774fa14c6841a0",
                "create_time": "2022-08-19 18:43:12",
                "docid": "177bccd41ba0406180e438c20e90a3c2",
                "create_serviceid": "76b5a705f2254ed3b1a356e2b50cef70",
                "sim_question_title": "文本超链接",
                "update_service_name": "曾懿",
                "create_service_name": "曾懿",
                "question_title": "文本超链接"
            },
            {
                "kbid": 39,
                "update_serviceid": "76b5a705f2254ed3b1a356e2b50cef70",
                "update_time": "2022-08-26 00:48:01",
                "questionid": "124efd04fab0406fb8eccb39ff52194d",
                "create_time": "2022-08-26 00:48:01",
                "docid": "a3eccfbd47f4464db60b552bf1abc6c1",
                "create_serviceid": "76b5a705f2254ed3b1a356e2b50cef70",
                "sim_question_title": "引导",
                "update_service_name": "曾懿",
                "create_service_name": "曾懿",
                "question_title": "引导"
            },
            {
                "kbid": 39,
                "update_serviceid": "76b5a705f2254ed3b1a356e2b50cef70",
                "update_time": "2022-08-26 00:48:01",
                "questionid": "54e2f046544a447fba454cae1f6a0bfd",
                "create_time": "2022-08-26 00:48:01",
                "docid": "a3eccfbd47f4464db60b552bf1abc6c1",
                "create_serviceid": "76b5a705f2254ed3b1a356e2b50cef70",
                "sim_question_title": "问题学习怎么学",
                "update_service_name": "曾懿",
                "create_service_name": "曾懿",
                "question_title": "问题学习怎么学"
            },
            {
                "kbid": 39,
                "update_serviceid": "76b5a705f2254ed3b1a356e2b50cef70",
                "update_time": "2022-08-26 00:48:01",
                "questionid": "59cf884d2dc945aab08bb70b4d2f5482",
                "create_time": "2022-08-26 00:48:01",
                "docid": "a3eccfbd47f4464db60b552bf1abc6c1",
                "create_serviceid": "76b5a705f2254ed3b1a356e2b50cef70",
                "sim_question_title": "引导问题3是什么?",
                "update_service_name": "曾懿",
                "create_service_name": "曾懿",
                "question_title": "引导问题3是什么?"
            },
            {
                "kbid": 39,
                "update_serviceid": "76b5a705f2254ed3b1a356e2b50cef70",
                "update_time": "2022-08-26 00:48:01",
                "questionid": "aa2096d2bd204434818483d3540eff78",
                "create_time": "2022-08-26 00:48:01",
                "docid": "a3eccfbd47f4464db60b552bf1abc6c1",
                "create_serviceid": "76b5a705f2254ed3b1a356e2b50cef70",
                "sim_question_title": "引导未采纳问题",
                "update_service_name": "曾懿",
                "create_service_name": "曾懿",
                "question_title": "引导未采纳问题"
            },
            {
                "kbid": 39,
                "update_serviceid": "76b5a705f2254ed3b1a356e2b50cef70",
                "update_time": "2022-08-26 00:48:01",
                "questionid": "ac5c48d659ee460fbeeb22696d97dafe",
                "create_time": "2022-08-26 00:48:01",
                "docid": "a3eccfbd47f4464db60b552bf1abc6c1",
                "create_serviceid": "76b5a705f2254ed3b1a356e2b50cef70",
                "sim_question_title": "未采纳问题",
                "update_service_name": "曾懿",
                "create_service_name": "曾懿",
                "question_title": "未采纳问题"
            },
            {
                "kbid": 39,
                "update_serviceid": "76b5a705f2254ed3b1a356e2b50cef70",
                "update_time": "2022-08-26 00:48:01",
                "questionid": "faac54f8417d420d802cae7da1c2766e",
                "create_time": "2022-08-26 00:48:01",
                "docid": "a3eccfbd47f4464db60b552bf1abc6c1",
                "create_serviceid": "76b5a705f2254ed3b1a356e2b50cef70",
                "sim_question_title": "未采纳问题?",
                "update_service_name": "曾懿",
                "create_service_name": "曾懿",
                "question_title": "未采纳问题?"
            },
            {
                "kbid": 41,
                "update_serviceid": "76b5a705f2254ed3b1a356e2b50cef70",
                "update_time": "2022-08-17 20:48:41",
                "questionid": "3aa3309d30cb48199937637668e43b20",
                "create_time": "2022-08-17 20:48:41",
                "docid": "000c2f46e88f447484b9f4b0b01dbcd1",
                "create_serviceid": "76b5a705f2254ed3b1a356e2b50cef70",
                "sim_question_title": "多轮测试按钮",
                "update_service_name": "曾懿",
                "create_service_name": "曾懿",
                "question_title": "多轮测试按钮"
            },
            {
                "kbid": 32,
                "update_serviceid": "b51be009d492428395879ce8c1c23313",
                "update_time": "2022-07-23 14:47:20",
                "questionid": "84307f62b02b4b85b563397427f01942",
                "create_time": "2022-07-23 14:47:20",
                "docid": "70f0cb497a4e44fb8cab2c712682e8e7",
                "create_serviceid": "b51be009d492428395879ce8c1c23313",
                "sim_question_title": "完全匹配继续添加1",
                "update_service_name": "baimingdan",
                "create_service_name": "baimingdan",
                "question_title": "完全匹配继续添加1"
            },
            {
                "kbid": 1,
                "update_serviceid": "cddc7690ffe44b719e2383f70ea62349",
                "update_time": "2022-07-21 14:28:20",
                "questionid": "7bf2438f1a4d4427b166d3390c773bca",
                "create_time": "2022-07-21 14:28:20",
                "docid": "397000a8c6604434aee8d5269db389be",
                "create_serviceid": "cddc7690ffe44b719e2383f70ea62349",
                "sim_question_title": "一问322346",
                "update_service_name": "耿璐",
                "create_service_name": "耿璐",
                "question_title": "一问322346"
            }
        ],
        "page_count": 7,
        "page_size": 10
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    # ● 添加知识库词条

    接口说明:

    接口类型:主动调用接口

    接口作用:可通过调用该接口来添加一个知识条目

    请求方式:

    POST

    请求地址:

    https://api-a.sobot.com/open/robot/v6/new_single/add_robot_doc
    
    1

    headers 请求头:

    参数 类型 必填 描述
    language String 否 语言标识:en-英文,zh-中文(默认中文)

    请求参数:

    参数 类型 必填 描述
    kbid String 是 知识库id
    question_title String 是 标准问题
    match_flag String 是 匹配模式:0-智能匹配,1-完全匹配,2-包含匹配
    question_typeid String 是 词条分类 id
    used_flag String 是 词条状态:0-开启,1-停用
    audit_status String 是 有效状态:1-永久有效;2-指定时间有效
    effect_time String 否 生效时间,格式:yyyy-MM-dd HH:mm:ss
    invalid_time String 否 失效时间,格式:yyyy-MM-dd HH:mm:ss
    answer_list List 是 答案数组

    answer_list对象:

    参数 类型 必填 描述
    answer_desc String 答案内容,html富文本
    msg_type String 答案类型:-1富文本

    返回参数:

    参数 类型 必填 描述
    ret_code String 是 返回编码
    ret_msg String 是 返回信息
    item Object 是 词条

    item对象:

    参数 类型 必填 描述
    docid String 是 词条id
    companyid String 是 公司id
    used_flag String 是 词条状态
    kbid Integer 是 知识库id

    请求示例:

    curl  https://api-a.sobot.com/open/robot/v6/new_single/add_robot_doc
    -X POST
    -H 'token: xxxxxxxxxxxxxxxxxxxxxxxxx' 
    -H 'Content-Type: application/json' 
    -H 'language: zh'
    -d '{
    	"kbid": 10,
    	"match_flag": "0",
    	"audit_status": "1",
    	"question_title": "open11111",
    	"question_typeid": "cbf5d929019b4e3fb50dc06ff9a36b29",
    	"answer_list": [{
    		"answer_desc": "<p>open11111</p>",
    		"msg_type": -1
    	}],
    	"invalid_time": "2022-08-29 23:59:59",
    	"used_flag": "0",
    	"effect_time": "2022-08-29 00:00:00"
    }'
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19

    返回示例:

    {
        "item": {
            "kbid": 10,
            "match_flag": 0,
            "create_time": 1661764052,
            "docid": "bc114dad4e954ca4a7e49a14915f0170",
            "audit_status": 1,
            "question_typeid": "cbf5d929019b4e3fb50dc06ff9a36b29",
            "updateid": "76b5a705f2254ed3b1a356e2b50cef70",
            "update_time": 1661764052,
            "companyid": "624f6b0bdcad4559bba55758b851f2e8",
            "createid": "76b5a705f2254ed3b1a356e2b50cef70",
            "link_flag": 1,
            "invalid_time": 4102415999,
            "used_flag": 0,
            "effective_scope": "0",
            "effect_time": 1661702400
        },
        "ret_msg": "操作成功",
        "ret_code": "000000",
        "items": []
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    # ● 修改知识库词条

    接口说明:

    接口类型:主动调用接口

    接口作用:可通过调用该接口来进行某个知识条目的修改操作

    请求方式:

    POST

    请求地址:

    https://api-a.sobot.com/open/robot/v6/new_single/update_robot_doc
    
    1

    headers 请求头:

    参数 类型 必填 描述
    language String 否 语言标识:en-英文,zh-中文(默认中文)

    请求参数:

    参数 类型 必填 描述
    docid String 是 词条id
    kbid String 是 知识库id
    question_title String 是 标准问题
    match_flag String 是 匹配模式:0-智能匹配,1-完全匹配,2-包含匹配
    question_typeid String 是 词条分类 id
    used_flag String 是 词条状态:0-开启,1-停用
    audit_status String 是 有效状态:1-永久有效;2-指定时间有效
    effect_time String 否 生效时间,格式:yyyy-MM-dd HH:mm:ss
    invalid_time String 否 失效时间,格式:yyyy-MM-dd HH:mm:ss
    answer_list List 是 答案数组

    answer_list对象:

    参数 类型 必填 描述
    answer_desc String 答案内容,html富文本
    msg_type String 答案类型:-1富文本

    返回参数:

    参数 类型 必填 描述
    ret_code String 是 返回编码
    ret_msg String 是 返回信息

    请求示例:

    curl https://api-a.sobot.com/open/robot/v6/new_single/update_robot_doc 
    -X POST
    -H 'token: xxxxxxxxxxxxxxxxxxxxxxxxx' 
    -H 'Content-Type: application/json' 
    -H 'language: zh' 
    -d '{
    	"kbid": 10,
        "docid": "bc114dad4e954ca4a7e49a14915f0170",
    	"match_flag": "0",
    	"audit_status": "1",
    	"question_title": "open11111",
    	"question_typeid": "cbf5d929019b4e3fb50dc06ff9a36b29",
    	"answer_list": [{
    		"answer_desc": "<p>open222sss2</p>",
    		"msg_type": -1
    	}],
    	"invalid_time": "2022-08-29 23:59:59",
    	"used_flag": "0",
    	"effect_time": "2022-08-29 00:00:00"
    }'
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20

    返回示例:

    {
        "ret_msg": "操作成功",
        "ret_code": "000000",
        "items": []
    }
    
    1
    2
    3
    4
    5
    # ● 删除知识库词条

    接口说明:

    接口类型:主动调用接口

    接口作用:可通过调用该接口来删除知识库中的某个知识条目

    请求方式:

    POST

    请求地址:

    https://api-a.sobot.com/open/robot/v6/new_single/delete_doc
    
    1

    headers 请求头:

    参数 类型 必填 描述
    language String 否 语言标识:en-英文,zh-中文(默认中文)

    请求参数:

    参数 类型 必填 描述
    docid_list List 是 词条 id集合 String类型集合
    kbid String 是 所属知识库

    返回参数:

    参数 类型 必填 描述
    ret_code String 是 返回编码
    ret_msg String 是 返回信息

    请求示例:

    curl https://api-a.sobot.com/open/robot/v6/new_single/delete_doc
    -X POST
    -H 'token: xxxxxxxxxxxxxxxxxxxxxxxxx' 
    -H 'Content-Type: application/json' 
    -H 'language: zh'
    -d '{
        "docid_list":["bc114dad4e954ca4a7e49a14915f0170"],
        "kbid":10
    }'
    
    1
    2
    3
    4
    5
    6
    7
    8
    9

    返回示例:

    {
        "ret_msg": "操作成功",
        "ret_code": "000000",
        "items": []
    }
    
    1
    2
    3
    4
    5

    # 错误编码

    # ● 操作成功
    错误编码 错误说明
    000000 操作成功(除此编码以外的编码为错误编码)
    # ● 系统异常
    错误编码 错误说明
    999999 系统未知异常
    401 token失效
    # ● 业务异常
    错误编码 错误说明
    400016 参数错误
    400002 添加失败,标准问法或者相似问法重复!
    400136 时间格式不正确
    400057 词条启用失败,获取企业数据错误!
    400006 词条超过上限!
    400022 答案过长!
    400026 词条不能为空!
    400012 操作词条不存在!
    402008 知识库ID不能为空
    402009 词条不存在或已被删除
    400001 问题标题不能为空
    400027 分类不能为空
    402010 分类id在当前知识库不存在或无效
    上次更新: 2023/10/23 10:28:12

    ← 在线消息转发 API 在线机器人统计 API→

    最近更新
    01
    运营支持 API
    03-03
    02
    CRM 对接方案
    12-05
    03
    大模型机器人API
    09-09
    更多文章>
    Theme by Vdoing
    • 跟随系统
    • 浅色模式
    • 深色模式
    • 阅读模式