开发者文档 开发者文档
帮助中心 (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-07-26
    目录

    在线统计 API

    # 在线统计 API

    # 接口声明

    在调用接口时必须在 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://www.sobot.com/api/get_token
    
    1

    请求参数:

    参数 类型 必填 描述
    appid String 是 接口凭证Id
    create_time String 是 时间戳
    sign String 是 签名:md5(appid + create_time + app_key) sign 签名,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://www.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

    请求地址:

     http://www.sobot.com/api/wb/5/data/robot_session
    
    1

    headers 请求头:

    参数 类型 必填 描述
    language String 是 语言标识:en-英文,zh-中文

    请求参数:

    参数 类型 必填 描述
    start_date String 是 开始日期(yyyy-MM-dd HH)
    end_date String 是 结束日期(yyyy-MM-dd HH)

    返回参数:

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

    item 对象:

    参数 类型 必填 描述
    consult_session String 机器人咨询会话
    valid_session String 机器人有效会话
    invalid_session String 机器人无效会话
    valid_reception_rate String 有效接待率
    self_reception_session String 机器人独立接待会话
    self_reception_rate String 独立接待率
    to_human_session String 转人工会话
    to_human_session_rate String 转人工会话率
    avg_session_duration String 平均会话时长

    请求示例:

    curl http://www.sobot.com/api/wb/5/data/robot_session
    -X POST 
    -H 'language: zh'
    -H 'content-type: application/json' 
    -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' 
    -d '{
            "start_date": "2019-08-01 01",
            "end_date": "2019-11-01 03"
        }'
    
    1
    2
    3
    4
    5
    6
    7
    8
    9

    返回示例:

    {
        "item": {
            "avg_session_duration": "00:00:07",
            "consult_session": "63",
            "invalid_session": "20",
            "self_reception_rate": "49%",
            "self_reception_session": "23",
            "to_human_session": "20",
            "to_human_session_rate": "51%",
            "valid_reception_rate": "25%",
            "valid_session": "43"
        },
        "ret_code": "000000",
        "ret_msg": "成功"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    # ● 机器人满意度统计

    接口说明:

    接口类型:主动调用接口

    接口作用:可通过调用该接口来获取机器人满意度评价统计结果。

    请求方式:

    POST

    请求地址:

     https://www.sobot.com/api/wb/5/data/robot_satisfaction
    
    1

    headers 请求头:

    参数 类型 必填 描述
    language String 是 语言标识:en-英文,zh-中文

    请求参数:

    参数 类型 必填 描述
    start_date String 是 开始日期(yyyy-MM-dd)
    end_date String 是 结束日期(yyyy-MM-dd)
    robotids String 否 机器人 id, 多个机器人中间以","隔开

    返回参数:

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

    item 对象:

    参数 类型 必填 描述
    effect_session_count String 机器人有效会话总数
    total_times String 已评价总数
    comment_rate String 参评率
    solved String 已解决数
    not_solved String 未解决数
    resolution_rate String 已解决率

    请求示例:

    curl https://www.sobot.com/api/wb/5/data/robot_satisfaction
    -X POST 
    -H 'language: zh'
    -H 'content-type: application/json' 
    -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' 
    -d '{
            "start_date": "2019-08-01",
            "end_date": "2019-11-01"
        }'
    
    1
    2
    3
    4
    5
    6
    7
    8
    9

    返回示例:

    {
        "item": {
            "comment_rate": "33%",
            "effect_session_count": "43",
            "not_solved": "1",
            "resolution_rate": "00%",
            "solved": "0",
            "total_times": "1"
        },
        "ret_code": "000000",
        "ret_msg": "成功"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    # ● 人工会话统计

    接口说明:

    接口类型:主动调用接口

    接口作用:可通过调用该接口来获取人工会话概览统计结果。

    请求方式:

    POST

    请求地址:

     https://www.sobot.com/api/wb/5/data/human_session
    
    1

    headers 请求头:

    参数 类型 必填 描述
    language String 是 语言标识:en-英文,zh-中文

    请求参数:

    参数 类型 必填 描述
    start_date String 是 开始日期(yyyy-MM-dd HH)
    end_date String 是 结束日期(yyyy-MM-dd HH)
    groupids String 否 技能组 id, 多个技能组中间以","隔开
    serviceids String 否 客服 id, 多个客服中间以","隔开 ,一次请求最多传递 100 个客服 id

    返回参数:

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

    item 对象:

    参数 类型 必填 描述
    consult_session String 人工咨询会话
    self_reception_session String 人工独立接待会话
    self_reception_session_rate String 人工独立接待会话占比
    valid_session String 人工有效会话
    invalid_session String 人工无效会话
    valid_session_rate String 人工有效会话率
    valid_reception_session String 人工有效接待会话
    invalid_reception_session String 人工无效接待会话
    invalid_reception_rate String 人工无效接待率
    not_reception_session String 人工未接待会话
    not_reception_session_rate String 人工未接待会话率
    transfer_session String 转接会话
    black_session String 拉黑会话
    avg_session_duration String 平均人工接待时长
    solved_session String 已解决会话
    not_solved_session String 未解决会话
    not_mark_is_solved String 未标注是否解决会话
    max_meantime_recption String 最大同时接待会话
    initiative_session String 主动发起会话量
    valid_reception_rate String 有效接待率
    transfer_in String 转入会话
    transfer_out String 转出会话
    response_time_avg_duration String 平均响应时长
    queue_accept_zb String 排队接通率
    avg_queue_accept_duration String 平均排队接通时长
    session_leave_in_queue String 排队离开会话
    accept_rate String 接通率
    response_time String 总响应时长
    response_times String 总响应次数

    请求示例:

    curl https://www.sobot.com/api/wb/5/data/human_session
    -X POST 
    -H 'language: zh'
    -H 'content-type: application/json' 
    -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' 
    -d '{
            "start_date": "2019-08-01 01",
            "end_date": "2019-11-01 03",
            "groupids": "a1d05d23f7744927a97bd6651d2b6ef7,edfcdcc480604bbc96f0585ee778a51a",
            "serviceids": "093685e7ae854979b3f07a97ea3685bc,738faf75873c4c47a79f4dfea83f164d"
        }'
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11

    返回示例:

    {
        "item": {
            "avg_session_duration": "00:07:15",
            "black_session": "3",
            "consult_session": "132",
            "initiative_session": "3",
            "invalid_reception_rate": "21%",
            "invalid_reception_session": "19",
            "invalid_session": "38",
            "max_meantime_recption": "4",
            "not_mark_is_solved": "125",
            "not_reception_session": "34",
            "not_reception_session_rate": "17%",
            "not_solved_session": "0",
            "self_reception_session": "73",
            "self_reception_session_rate": "66%",
            "solved_session": "7",
            "transfer_in": "1",
            "transfer_out": "1",
            "transfer_session": "0",
            "valid_reception_rate": "62%",
            "valid_reception_session": "41",
            "valid_session": "94",
            "valid_session_rate": "21%",
            "response_time_avg_duration":"00:02:32",
            "queue_accept_zb":"67%",
            "avg_queue_accept_duration":"00:10:40",
            "session_leave_in_queue":"2",
            "accept_rate":"26%",
            "response_time":"1000",
            "response_times":"2"
        },
        "ret_code": "000000",
        "ret_msg": "成功"
    }
    
    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
    # ● 人工满意度统计

    接口说明:

    接口类型:主动调用接口

    接口作用:可通过调用该接口来获取人工满意度评价统计结果。

    请求方式:

    POST

    请求地址:

     https://www.sobot.com/api/wb/5/data/human_satisfaction
    
    1

    headers 请求头:

    参数 类型 必填 描述
    language String 是 语言标识:en-英文,zh-中文

    请求参数:

    参数 类型 必填 描述
    start_date String 是 开始日期(yyyy-MM-dd HH)
    end_date String 是 结束日期(yyyy-MM-dd HH)
    groupids String 否 技能组 id, 多个技能组中间以","隔开,一次请求最多传递 100 个技能组 id
    serviceids String 否 客服 id, 多个客服中间以","隔开 ,一次请求最多传递 100 个客服 id

    返回参数:

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

    item 对象:

    参数 类型 必填 描述
    effect_session_count String 人工有效会话总数
    total_times String 已评价总数
    comment_rate String 参评率
    initiative String 客户主动参评
    initiative_rate String 客户主动参评占比
    invites_rate String 客服邀请参评占比
    invite_counts String 客服邀评数
    invites String 客服邀请参评
    solved_count String 评价解决总数
    solved String 已解决数
    not_solved String 未解决数
    solved_rate String 已解决率
    avg_num String 平均分
    good String 好评数
    good_rate String 好评率
    middle String 中评数
    middle_rate String 中评率
    bad String 差评数
    bad_rate String 差评率
    score4 String 4 分数
    score3 String 3 分数
    score2 String 2 分数
    score1 String 1 分数

    请求示例:

    curl https://www.sobot.com/api/wb/5/data/human_satisfaction
    -X POST 
    -H 'language: zh'
    -H 'content-type: application/json' 
    -H 'token: 4ac37cb2e9c740dba4b75334d5358802' 
    -d '{
            "start_date": "2021-02-01 01",
            "end_date": "2021-03-01 03",
            "groupids": "a1d05d23f7744927a97bd6651d2b6ef7,edfcdcc480604bbc96f0585ee778a51a",
            "serviceids": "093685e7ae854979b3f07a97ea3685bc,738faf75873c4c47a79f4dfea83f164d"
        }'
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11

    返回示例:

    {
        "item": {
            "avg_num": "80",
            "bad": "1",
            "bad_rate": "00%",
            "comment_rate": "32%",
            "effect_session_count": "94",
            "good": "2",
            "good_rate": "00%",
            "initiative": "3",
            "initiative_rate": "00%",
            "invites": "2",
            "invites_rate": "-00%",
            "middle": "2",
            "middle_rate": "00%",
            "not_solved": "0",
            "score1": "0",
            "score2": "1",
            "score3": "1",
            "score4": "1",
            "solved": "5",
            "solved_count": "5",
            "solved_rate": "100%",
            "total_times": "5"
        },
        "ret_code": "000000",
        "ret_msg": "成功"
    }
    
    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
    # ● 客户会话统计

    接口说明:

    接口类型:主动调用接口

    接口作用:可通过调用该接口来获取客户会话概览统计结果。

    请求方式:

    POST

    请求地址:

     https://www.sobot.com/api/wb/5/data/customer_session
    
    1

    headers 请求头:

    参数 类型 必填 描述
    language String 是 语言标识:en-英文,zh-中文

    请求参数:

    参数 类型 必填 描述
    start_date String 是 开始日期(yyyy-MM-dd)
    end_date String 是 结束日期(yyyy-MM-dd)

    返回参数:

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

    item 对象:

    参数 类型 必填 描述
    total_consult_session String 总咨询会话
    total_valid_session String 总有效会话
    total_valid_session_rate String 总有效会话率
    avg_session_duration String 平均总会话接待时长
    avg_total_session_duration String 平均总会话时长
    total_invalid_session String 总无效会话

    请求示例:

    curl https://www.sobot.com/api/wb/5/data/customer_session
    -X POST 
    -H 'language: zh'
    -H 'content-type: application/json' 
    -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' 
    -d '{
            "start_date": "2019-08-01",
            "end_date": "2019-11-01"
        }'
    
    1
    2
    3
    4
    5
    6
    7
    8
    9

    返回示例:

    {
        "item": {
            "avg_session_duration": "00:04:03",
            "avg_total_session_duration": "00:08:53",
            "total_consult_session": "170",
            "total_invalid_session": "53",
            "total_valid_session": "117",
            "total_valid_session_rate": "82%"
        },
        "ret_code": "000000",
        "ret_msg": "成功"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    # ● 会话消息统计

    接口说明:

    接口类型:主动调用接口。

    接口作用:可通过调用该接口来获取会话消息统计结果。

    请求方式:

    POST

    请求地址:

     https://www.sobot.com/api/wb/5/data/message_stats
    
    1

    headers 请求头:

    参数 类型 必填 描述
    language String 是 语言标识:en-英文,zh-中文

    请求参数:

    参数 类型 必填 描述
    start_date String 是 开始时间
    end_date String 是 结束时间

    返回参数:

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

    item 对象:

    参数 类型 必填 描述
    total_message String 总会话消息数
    robot_message String 机器人消息数
    total_customer_message String 客户消息数
    service_message String 客服消息数
    avg_message String 平均每会话消息数
    avg_customer_message String 平均每会话客户消息数
    avg_service_messge String 平均每会话客服消息数
    customer_to_robot_message String 客户消息数
    robot_avg_message String 平均每会话消息数
    robot_avg_customer_message String 平均每会话客户消息数
    total_human_message String 总人工会话消息数
    customer_to_service_message String 客户消息数
    answer_than String 答问比
    human_avg_message String 平均每会话消息数
    human_avg_customer_message String 平均每会话客户消息数
    human_avg_service_message String 平均每会话客服消息数
    service_word String 客服字数
    avg_service_word String 平均每会话客服字数
    service_offline_num String 客服离线消息数

    请求示例:

    curl https://www.sobot.com/api/wb/5/data/message_stats 
    -X POST 
    -H 'language: zh'
    -H 'content-type: application/json' 
    -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' 
    -d '{
            "start_date": "2019-08-01",
            "end_date": "2019-11-01"
        }'
    
    1
    2
    3
    4
    5
    6
    7
    8
    9

    返回示例:

    {
        "item": {
            "answer_than": "78%",
            "avg_customer_message": "03",
            "avg_message": "59",
            "avg_service_messge": "89",
            "avg_service_word": "18",
            "customer_to_robot_message": "78",
            "customer_to_service_message": "277",
            "human_avg_customer_message": "95",
            "human_avg_message": "3",
            "human_avg_service_message": "35",
            "robot_avg_customer_message": "81",
            "robot_avg_message": "63",
            "robot_message": "78",
            "service_message": "221",
            "service_offline_num": "21",
            "service_word": "1427",
            "total_customer_message": "355",
            "total_human_message": "498",
            "total_message": "654"
        },
        "ret_code": "000000",
        "ret_msg": "成功"
    }
    
    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
    # ● 获取在线质检结果

    接口说明:

    接口类型:主动调用接口。

    接口作用:获取在线质检结果

    请求方式:

    POST

    请求地址:

     https://www.sobot.com/api/wb/5/data/quality_result
    
    1

    headers 请求头:

    参数 类型 必填 描述
    language String 是 语言标识:en-英文,zh-中文

    请求参数:

    参数 类型 必填 描述
    start_date String 是 开始日期
    end_date String 是 结束日期
    page String 否 当前页码
    size String 否 每页条数(默认 100,最大可传入 10,000)

    返回参数:

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

    item 对象:

    参数 类型 必填 描述
    chat_start_time String 会话开始时间(毫秒值)
    update_time String 质检时间
    schemeid String 质检方案 id
    total_score String 质检方案满分
    standard_total_score String 质检标准分满分
    add_total_score String 质检加分项满分
    minus_total_score String 质检减分项满分
    quality_score String 质检得分
    standard_quality_score String 质检标准分得分
    add_quality_score String 质检加分项得分
    minus_quality_score String 质检减分项得分
    staffid String 客服 id
    staff_name String 客服姓名
    email String 客服邮箱
    cid String 会话 id

    请求示例:

    curl https://www.sobot.com/api/wb/5/data/quality_result 
    -X POST 
    -H 'language: zh'
    -H 'content-type: application/json' 
    -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' 
    -d '{
            "start_date": "2019-08-01",
            "end_date": "2019-11-01",
            "page":"1",
            "size":"100"
        }'
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11

    返回示例:

    {
        "items": [
            {
                "add_quality_score": "0",
                "add_total_score": "0",
                "chat_start_time": "1572851882000",
                "cid": "eca23a4cb2ba45bbab32b6878775cfd2",
                "email": "123456@1com",
                "minus_quality_score": "-0",
                "minus_total_score": "-0",
                "quality_score": "20",
                "schemeid": "44aea7fd6f57414f98d190bac0ee2d42",
                "staff_name": "在线客服",
                "staffid": "61673ee8d98d4282a95cdad38ffd5f5b",
                "standard_quality_score": "20",
                "standard_total_score": "20",
                "total_score": "20",
                "update_time": "1572954558319"
            }
        ],
        "ret_code": "000000",
        "ret_msg": "查询成功"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    # ● 离线数据文件下载接口

    接口说明:

    接口类型:主动调用接口。

    接口作用:可通过调用该接口来获取各个业务模块的原始数据,可用于企业对数据归档或做数据分析等。

    注意:若需要使用该接口下载离线数据,需提前通知智齿进行数据整理安排,否则无法下载到数据。

    请求方式:

    POST

    请求地址:

     https://www.sobot.com/api/wb/5/data/export_data
    
    1

    headers 请求头:

    参数 类型 必填 描述
    language String 是 语言标识:en-英文,zh-中文

    请求参数:

    参数 类型 必填 描述
    task_type String 是 任务类型 1:visit、2:conversation、3:evaluation、4:msg、5:user、6:ticket
    date String 是 日期(yyyy-MM-dd)

    返回参数:

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

    item 对象:

    参数 类型 必填 描述
    companyid String 公司ID
    create_time String 创建时间
    task_type String 任务类型
    result_date String 日期
    file_path String 文件路径
    description String 描述

    请求示例:

    curl https://www.sobot.com/api/wb/5/data/export_data 
    -X POST 
    -H 'language: zh'
    -H 'content-type: application/json' 
    -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' 
    -d '{
            "task_type":  "2",
            "date": "2019-11-05"
        }'
    
    1
    2
    3
    4
    5
    6
    7
    8
    9

    返回示例:

    {
        "item": {
            "file_path": "https://sobot-test.oss-cn-beijing.aliyuncs.com/expo105-zip",
            "companyid": "7e20834c439748c780ca9648ca6c0cde",
            "create_time": "1573027669037",
            "result_date": "2019-11-05",
            "task_type": "2"
        },
        "ret_code": "000000",
        "ret_msg": "成功"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    # ● 订单统计推送接口

    接口说明:

    接口作用:客服订单推送接口

    请求方式:

    POST

    请求地址:

     https://www.sobot.com/chat-third/api/5/order/receive_order_data
    
    1

    headers 请求头:

    参数 类型 必填 描述
    language String 是 语言标识:en-英文,zh-中文

    请求参数:

    参数 类型 必填 描述
    union_code String 否 平台 ID :不能大于 32 个字符
    companyid String 否 公司 ID :不能大于 32 个字符
    order_number String 是 订单编号 :不能大于 32 个字符
    cus_partnerid String 是 下订单客户对接 ID :不能大于 32 个字符
    order_time String 是 订单时间 :格式:2019-09-25 15:49:33
    order_money String 是 订单金额 :最大支持小数点后两位

    返回参数:

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

    请求示例:

    {
        "union_code": "10001",
        "companyid": "5ae23431d5605a76fa11b40",
        "order_number": "WERW34B",
        "cus_partnerid": "389dshjkd",
        "order_time": "2020-04-30 20:11:00",
        "order_money": "899"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8

    返回示例:

    {
        "ret_code": "000000",
        "ret_msg": "操作成功"
    }
    
    1
    2
    3
    4
    # ● 客服统计

    接口说明:

    接口类型:主动调用接口

    接口作用:可通过调用该接口来获取客服统计数据。

    请求方式:

    POST

    请求地址:

     https://www.sobot.com/api/wb/5/data/get_service_data
    
    1

    headers 请求头:

    参数 类型 必填 描述
    language String 是 语言标识:en-英文,zh-中文

    请求参数:

    参数 类型 必填 描述
    start_date String 是 开始日期(yyyy-MM-dd HH)
    end_date String 是 结束日期(yyyy-MM-dd HH)
    groupids String 否 技能组 id, 多个技能组中间以","隔开,一次请求最多传递 100 个客服 id
    serviceids String 否 客服 id, 多个客服中间以","隔开 ,一次请求最多传递 100 个客服 id

    返回参数:

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

    item 对象:

    参数 类型 必填 名称
    valid_session String 人工有效会话
    valid_reception_session String 人工有效接待会话
    not_reception_session String 人工未接待会话
    invalid_reception_session String 人工无效接待会话
    transfer_out String
    score5 String 5 分数
    score4 String 4 分数
    score3 String 3 分数
    score2 String 2 分数
    score1 String 1 分数
    total_times String 已评价总数
    groupid String 组 id
    serviceid String 客服 id
    response_in30s_rate String 30s 应答率
    avg_first_response_time String 平均首次响应时长
    transfer_first_response_rate String 转接后首次响应率

    请求示例:

    curl https://www.sobot.com/api/wb/5/data/get_service_data
    -X POST 
    -H 'language: zh'
    -H 'content-type: application/json' 
    -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' 
    -d '{
            "start_date": "2019-08-01 01",
            "end_date": "2019-11-01 03",
            "groupids": "a1d05d23f7744927a97bd6651d2b6ef7,edfcdcc480604bbc96f0585ee778a51a",
            "serviceids": "093685e7ae854979b3f07a97ea3685bc,738faf75873c4c47a79f4dfea83f164d"
        }'
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11

    返回示例:

    {
        "items":[
            {
                "avg_first_response_time":"00:00:05",
                "groupid":"a1d05d23f7744927a97bd6651d2b6ef7",
                "invalid_reception_session":"0",
                "not_reception_session":"1",
                "response_in30s_rate":"00%",
                "score1":"0",
                "score2":"0",
                "score3":"0",
                "score4":"0",
                "score5":"0",
                "serviceid":"093685e7ae854979b3f07a97ea3685bc",
                "total_times":"0",
                "transfer_first_response_rate":"00%",
                "transfer_out":"0",
                "valid_reception_session":"0",
                "valid_session":"1"
            },
            {
                "avg_first_response_time":"00:01:02",
                "groupid":"edfcdcc480604bbc96f0585ee778a51a",
                "invalid_reception_session":"0",
                "not_reception_session":"0",
                "response_in30s_rate":"00%",
                "score1":"0",
                "score2":"0",
                "score3":"0",
                "score4":"0",
                "score5":"0",
                "serviceid":"738faf75873c4c47a79f4dfea83f164d",
                "total_times":"0",
                "transfer_first_response_rate":"00%",
                "transfer_out":"0",
                "valid_reception_session":"0",
                "valid_session":"0"
            }
        ],
        "ret_code":"000000",
        "ret_msg":"成功"
    }
    
    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
    # ● 客服登录时长统计

    接口说明:

    接口类型:主动调用接口

    接口作用:可通过调用该接口来获取客服登录时长数据

    请求方式:

    POST

    请求地址:

     https://www.sobot.com/api/wb/5/data/human_duration
    
    1

    headers 请求头:

    参数 类型 必填 描述
    language String 是 语言标识:en-英文,zh-中文

    请求参数:

    参数 类型 必填 描述
    start_date String 是 开始日期 (yyyy-MM-dd)
    end_date String 是 结束日期 (yyyy-MM-dd)
    groupids String 否 技能组 id, 多个技能组中间以","隔开 ,一次请求最多传递 100 个技能组 id
    serviceids String 否 客服 id, 多个客服中间以","隔开 ,一次请求最多传递 100 个客服 id。 同时传 groupids 和 serviceids 时, 以 serviceids 为准

    注意:groupids和serviceids两个参数至少填写其中一个

    返回参数:

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

    item 对象:

    参数 类型 必填 名称
    login_duration String 登录时长
    online_duration String 在线时长
    busy_duration String 忙碌时长
    train_duration String 培训时长
    eat_duration String 用餐时长
    meet_duration String 会议时长
    active_duration String 活动时长
    rest_duration String 小休时长
    serviceid String 客服 id

    请求示例:

    curl https://www.sobot.com/api/wb/5/data/human_duration
    -X POST 
    -H 'language: zh'
    -H 'content-type: application/json' 
    -H 'token: uac37cb1e9c740dba4b75a34d54n88a2' 
    -d '{
        "start_date":"2021-03-12",
        "end_date":"2021-03-18",
        "serviceids":"ffb4fccb6c3a48a6b185ob5de171b6bb,083685e7a18549b9b3f07a97ea3675bc"
    }'
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    返回示例:

    {
        "items":[
            {
                "login_duration":"00:16:11",
                "online_duration":"00:16:12",
                "busy_duration":"00:16:13",
                "train_duration":"00:16:14",
                "eat_duration":"00:16:15",
                "meet_duration":"00:16:16",
                "active_duration":"00:16:17",
                "rest_duration":"00:16:18",
                "serviceid":"ffb4fccb6c3a48a6b185ob5de171b6bb"
            },
            {
                "login_duration":"00:17:11",
                "online_duration":"00:17:12",
                "busy_duration":"00:17:13",
                "train_duration":"00:17:14",
                "eat_duration":"00:17:15",
                "meet_duration":"00:17:16",
                "active_duration":"00:17:17",
                "rest_duration":"00:17:18",
                "serviceid":"083685e7a18549b9b3f07a97ea3675bc"
            }
        ],
        "ret_code":"000000",
        "ret_msg":"成功"
    }
    
    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

    # 错误编码

    # ● 操作成功
    错误编码 错误说明
    000000 操作成功(除此编码以外的编码为错误编码)
    # ● 系统异常
    错误编码 错误说明
    910001 token 为空
    910002 token 已失效,请重新获取
    910003 signature 错误
    910004 没有找到公司的 api 配置信息
    999999 系统未知异常
    # ● 业务异常
    错误编码 错误说明
    210003 传入日期为空
    210004 传入类型为空
    210005 日期传入错误
    210006 参数信息传入错误
    210007 groupids 或 serviceids 传参异常,长度超限
    210015 需提前通知智齿进行数据整理安排,否则无法下载到数据
    210016 请求参数类型错误(订单编号不能为空 / 对接 id 不能为空 / 金额格式不正确等错误信息)
    210017 每分钟调用次数达到限制(每分钟可调用 1000 次)
    220000 [x] 为必填项,不能为空
    220001 [x] 的长度超过最大限制,最多允许 y 个字符
    220002 [x] 的值必须在 y 到 z 之间
    220003 [x] 的值无效,允许的值为: y,z
    220004 [x] 的值不是时间戳
    220005 [x] 的值不是有效的邮箱地址
    220006 [x] 参数类型错误
    220007 [x] 参数错误,不是一个合法的JSON
    上次更新: 2025/3/12 17:33:00

    ← 在线客服 API 在线机器人 API→

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