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

    在线消息转发 API

    # 在线消息转发 API

    # 在线消息转发

    该功能消息格式为 Json 格式;实时消息推送配置每30min更新一次。同公司同类型的数据,缓存 20 条打包发送一次,不足 20 条时每 1 秒打包发送一次。

    实时消息推送需要客户提供数据接收接口,例如 https://xxxxxxx.xxxxxx.com/sobot/message ,所有的类型的数据使用相同的地址。

    消息转发接口,增加可以加密后再传递,可以联系您的客户经理,设置开通后,可以在消息转发时 header 中增加三个参数:时间戳(取服务器时间)、随机码、sign(MD5加密,32位 小写)客户取到参数后解码对比,正确接收数据,错误时返回错误码。

    header中参数:

    参数 类型 必填 描述
    X-Log-TimeStamp String 时间戳(取服务器时间:毫秒)
    X-Log-RandomCode String 随机码
    X-Log-Sign String sign 签名,对 companyId,时间戳(取服务器时间),随机码 ,appKey(配置消息转发时使用的密钥)按照顺序进行字符串拼接,使用 MD5 摘要算法(32 位小写)所得值

    请求示例:

    curl  https://xxxxxxx.xxxxxx.com/sobot/message
    -X POST 
    -H 'X-Log-TimeStamp: 1609224926723'
    -H 'X-Log-RandomCode: 635'
    -H 'X-Log-Sign: 9ba80f40bc5e6fd404648ea15aa4f7fa'
    
    1
    2
    3
    4
    5
    # ● 在线会话消息V2(Deprecated)

    content 对象:

    参数 类型 必填 描述
    companyid String 是 公司 Id, 适用一个公司多个超管帐号或者多个分公司需要分别统计的情况
    cid String 是 会话 id
    source String 是 用户来源:0 桌面网站、1 微信、2 App、3 微博、4 移动网站、6 呼叫、7 工单中心、8 客户中心、9 企业微信、10 小程序、12 百度营销、13 今日头条、14 奇虎360、15 阿里汇川、16 搜狗、17 微信客服、20 广点通、21 知乎、22 facebook、23 whatsApp、24 instagram、25 line、26 discord、33 telegram
    start_time String 是 开始时间,unixtime ms,例如:"1539153409792"
    end_time String 是 结束时间,unixtime ms,例如:"1539153409792"
    first_response_time String 是 首次响应时长ms,例如:"9792"
    transfer_tohuman_time String 否 机器人转人工时间(机器人有效并且人工有效才赋值),值同access_human_time,unixtime ms,例如:"1539153409792"
    conversation_duration String 是 会话时长,单位:毫秒
    staff_emails String 是 最后接待客服 Email
    staff_name String 是 最后接待客服姓名
    consult_robot_msg_count String 是 咨询机器人消息数
    robot_reply_msg_count String 是 机器人回复数
    consult_staff_msg_count String 是 咨询人工消息数
    staff_reply_msg_count String 是 人工回复数
    transfer_human_succ_flag String 是 转人工是否成功,1-是;0-否
    queue_time String 是 排队时长,单位:毫秒
    session_queue_state String 是 排队状态,1:未排队接通、2:排队成功、3:排队离开
    ip String 是 访问 IP,格式: "255.255.255.255"
    area String 是 地域
    os String 是 终端,1:Windows XP、2:Windows 7、3:Windows 8、4:Windows Vista、5:Windows 其他、6:Linux、7:macOS、8:Android、9:iOS、11:Windows 2000、12:Windows 10、其他:其他
    visitorid String 是 用户 ID
    partnerid String 是 合作方用户 ID
    lastgroupid String 是 最后接待客服组 Id
    lastgroup_name String 是 最后接待客服组名称
    offline_type String 是 会话结束方式,1:客服离线、2:客户被客服移除、3:客户被客服加入黑名单、4:客户会话超时、5:客户关闭了聊天页面、6:客户打开新的页面
    human_valid_flag String 是 是否是人工有效会话,1: 是、0:否
    human_invalid_flag String 是 是否是人工无效会话,1: 是、0:否
    human_invalid_recep_flag String 是 是否是人工无效接待,1: 是、0:否
    human_valid_recep_flag String 是 是否是人工有效接待,1: 是、0:否
    human_recep_flag String 是 是否是人工接待,1: 是、0:否
    robot_invalid_flag String 是 是否是机器人无效会话,1:是、0:否
    robot_valid_flag String 是 是否是机器人有效会话, 1:是、0:否
    province_name String 是 省份名称
    city_name String 是 城市名称
    access_human_time String 是 接入人工成功时间
    robotid String 否 机器人 id
    lastrobotid String 否 最后接待机器人ID
    lastrobot_name String 否 最后接待机器人名称
    robot_alias String 否 机器人别名 机器人的对接参数,优先级高于 robotid,目前仅支持 APP 渠道
    robot_name String 否 机器人昵称
    staffids String 否 所有接待客服 Id,以逗号分割;
    invite_evaluation_flags String 否 客服是否发起邀评,对应接待客服 Id 的顺序,1:发起过邀评、0:未发起邀评
    response_duration Long 是 总响应时长:毫秒
    response_count Int 是 总响应次数
    response_avg String 是 平均响应时长 = 总响应时长 / 总响应次数
    session_human_duration String 是 人工接待时长
    asHuman_interactive_count String 是 人工交互会话数
    channel_flag String 是 子渠道 Id
    channel_name String 是 子渠道名称
    search_engine String 否 搜索来源,1:百度自然搜索、2:百度付费搜索、3:360搜索、4:sougou、5:神马、6:必应、7:谷歌、8:其他搜索引擎、9:直接访问、10:外部链接、11:百度未知访问
    land_page_url String 否 着陆页 url
    land_page_title String 否 着陆页标题
    conversation_page_url String 否 发起会话页 url
    conversation_page_title String 否 发起会话页标题
    search_word String 否 搜索词
    human_transfer_count String 否 转接次数
    human_transfer_timestamps String 否 转接时间点,单位毫秒,以英文逗号分隔;例如:1468827002400,1468826506677

    注:唯一主键 cid,各表通过 cid 关联,表示同一个会话

    请求参数:

    参数 类型 必填 描述
    sys_code String 是 产品编码,21
    type String 是 消息类型,conversation
    content List 是 消息内容

    请求报文样例:

    { 
      "sys_code":"21",
        "type":"conversation",
        "content":[
            {
                "companyid":"5cc2c708202d4defaf72d4bcac362a55",
                "cid":"86937e82ae244ad59aeefe41af731079",
                "source":"2",
                "start_time":"1468826506677",
                "partnerid":"1907281202433341",
                "end_time":"1468827002400",
                "first_response_time":"9792",
                "transfer_tohuman_time":"1468826506677",
                "conversation_duration":"495723",
                "staff_emails":"11122221@foxmail.com",
                "staff_name":"路人丁",
                "consult_robot_msg_count":"3",
                "robot_reply_msg_count":"20",
                "consult_staff_msg_count":"0",
                "staff_reply_msg_count":"0",
                "transfer_human_succ_flag":"1",
                "queue_time":"0",
                "session_queue_state":"2",
                "ip":"138",
                "area":"辽宁",
                "os":"8",
                "visitorid":"837213545777846",
                "lastgroupid":"35980200f279438b952f8dc3d5731f85",
                "lastgroup_name":"客服组",
                "human_valid_flag":"1",
                "human_invalid_flag":"0",
                "human_invalid_recep_flag":"0",
                "human_valid_recep_flag":"0",
                "human_recep_flag":"1",
                "robot_invalid_flag":"0",
                "robot_valid_flag":"1",
                "offline_type":"1",
                "access_human_time":"1584806400000",
                "robotid": "1",
                "lastrobotid": "1",
                "lastrobot_name": "机器人小明",
                "robot_alias": "test_alias",
                "robot_name": "机器人小明",
                "staffids":"3695089d031c409380073081aaa73c7d,733e9edabb5c4158b095198aec58a890,3ff11cb243b540f78f8274f84b289920",
                "invite_evaluation_flags":"0,1,1",
                "channel_flag": "d720fe0e97ac427183c65b59f82c061f",
                "channel_name": "Android - 正式",
                "response_duration": "0",
                "response_count": "0",
                "response_avg": "0",
                "session_human_duration": "0",
                "asHuman_interactive_count": "0",
                "search_engine": "1",
                "land_page_url": "http://www.sobot.com",
                "land_page_title": "【官网】智齿科技-智齿客服 | 在线客服系统_云呼叫中心_智能客服机器人_智能外呼",
                "conversation_page_url": "http://www.sobot.com", 
                "conversation_page_title": "【官网】智齿科技-智齿客服 | 在线客服系统_云呼叫中心_智能客服机器人_智能外呼",
                "search_word": "客服",
                "human_transfer_count": "2",
                "human_transfer_timestamps": "1468827002400,1468826506677"
            }
        ]
    }
    
    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
    # ● 在线会话消息V6

    content 对象:

    参数 类型 必填 描述
    trigger_to_staff_flag String 是 是否触发转人工: 1 是,0 否
    transfer_to_staff_succ_flag String 是 转人工是否成功: 1 是,0 否
    access_staff_time String 否 接通人工时间戳,例如:1704168121000
    cid String 是 会话ID
    companyid String 是 接入会话时所属公司ID
    chat_start_time String 是 会话开始时间,例如:1704168121000
    chat_end_time String 是 会话结束时间,例如:1704168121000
    human_consult String 是 人工咨询会话: 1 是,0 否
    human_self String 是 人工独立接待(只计算未发生转接的会话,不包含与机器人接待的):1 是,0 否
    human_transfer String 是 转接会话,不包含超时转接: 1 是,0 否
    human_transfer_time_out String 是 是否是超时转接: 1 是,0 否
    human_snatch String 是 是否是抢接会话:1 是,0 否
    human_valid String 是 是否是人工有效会话:1 是,0 否
    human_valid_recep String 是 是否是人工有效接待:1 是,0 否
    human_invalid String 是 是否是人工无效会话:1 是,0 否
    human_invalid_recep String 是 是否是人工无效接待会话:1 是,0 否
    human_not_recep String 是 是否是人工未接待:1 是,0 否
    human_initiative String 否 是否主动邀请发起会话,只计算首次接入的人工客服:1 是,0 否
    queue_start_time String 否 排队开始时间,例如:1704168121000
    queue String 是 是否是排队会话,只计算首次接入的人工:1 是,0 否
    not_queue String 是 是否是未排队会话,只计算首次接入的人工:1 是,0 否
    queue_not_accept String 是 是否是未排队接通,只计算首次接入的人工:1 是,0 否
    queue_accept String 是 是否是排队接通会话:1 是,0 否
    queue_interrupt String 是 是否是排队中断:1 是,0 否
    human_accept_queue_duration String 否 排队接通时长,只计算首个客服,单位:毫秒,例如:80909
    queue_leave String 是 排队离开会话:1 是,0 否
    human_leave_queue_duration String 否 排队离开时长,单位:毫秒,例如:80909
    msg_visitor_to_staff String 否 客户发给客服消息数
    msg_staff String 否 人工客服消息数
    msg_total String 否 总消息数=msg_robot+msg_visitor_to_robot+msg_staff+msg_visitor_to_staff
    msg_staff_word_count String 否 客服发送字数
    human_forward_times String 否 点击人工转接成功次数
    staff_first_res_duration String 否 首响时长,只计算客户发送首条消息之后,单位:毫秒,例如:50603
    staff_first_res60s_tag String 否 60s内应答标记:1 是,0 否
    staff_first_res30s_tag String 否 30s内应答标记:1 是,0 否
    staff_res_total_duration String 否 总响应时长,单位:毫秒,例如:111909
    staff_valid_res_count String 否 人工有效交互数 ,客服与访客之间完整的会话轮次>=2
    staff_res_total_count String 否 总响应次数
    max_response_duration String 否 最大响应时长,单位:毫秒,例如:80909
    staff_res_duration_avg String 否 人工平均响应时长,单位:毫秒,例如:80909
    human_recep_duration String 否 人工接待时长,单位:毫秒,例如:80909
    last_msg_staff String 是 最后一条消息为客服消息的会话标记:1 是,0 否
    human_self_valid_recep String 是 人工独立有效接待:1 是,0 否,human_self==1 && human_valid_recep==1
    human_consult_duration String 是 接入人工咨询时长=chat_end_time - access_staff_time ,单位:毫秒,例如:80909
    human_visitor_consult String 是 是否是人工有效咨询:1 是,0 否, msg_visitor_to_staff>0
    queue_type String 否 排队类型 1-vip,2-指定优先,3-普通客户转优先,0-普通排队,-1-未开启排队优先
    last_staffid String 否 最后接待客服ID
    last_staff_name String 否 最后接待客服姓名
    groupids String 否 参与技能组ID,以英文逗号分开
    last_groupid String 否 最后接待技能组Id
    last_group_name String 否 最后接待技能组名称
    visitorid String 是 访客ID
    first_staffid String 否 首次接待客服Id
    first_staff_name String 否 首次接待客服姓名
    first_groupid String 否 首次接待技能组Id
    first_group_name String 否 首次接待技能组名称
    offline_type String 否 会话结束方式 1 客服离线 2被客服主动踢下线 3 客户被加入黑名单 4客户超时下线 5客户主动下线
    as_human_interactive_count String 否 人工交互会话数
    last_staff_email String 否 最后客服邮箱
    session_consult String 是 总咨询会话:1 是,0 否
    robot_recep_duration String 否 机器人接待时长,单位:毫秒,例如:80909
    session_recep_duration String 否 总接待时长=robot_recep_duration+human_recep_duration,单位:毫秒,例如:80909
    human_recep_duration String 否 人工接待时长,单位:毫秒,例如:80909
    total_duration String 是 总时长=chat_end_time - chat_start_time,单位:毫秒,例如:80909
    session_invalid String 是 总无效会话:1 是,0 否
    session_valid String 是 总有效会话:1 是,0 否
    visitor_first_msg_time String 是 访客首次咨询时间,单位毫秒,例如 1704128521000
    robot_valid_transfer_succ String 是 机器人有效会话触发转人工成功: 1 是 0否,trigger_to_staff_flag==1 && robot_valid==1
    join_type String 否 接入类型 1,仅机器人 2.只有人工 3.智能客服-机器人优先 4智能客服-人工客服优先
    robot_direct_transfer_succ String 是 直接转人工转接成功: 1 是 0否, join_type in (3,4) and(robot_to_staff_active_box==1 or robot_to_staff_trigger_key_word==1)and trigger_to_staff_succ_flag==1
    robotids String 否 参与机器人id,按逗号分隔
    robot_names String 否 参与机器人名称,按逗号分隔
    first_receive_robotid String 否 首次接待机器人ID
    first_receive_robot_name String 否 首次接待机器人名称
    last_robotid String 否 最后接待机器人ID
    last_robot_name String 否 最后接待机器人名称
    robot_alias String 否 机器人别名,对接参数
    staffids String 否 参与人工客服,按逗号分隔
    msg_visitor_to_robot String 否 访客对机器人消息数
    msg_robot String 否 机器人消息数
    msg_actual_robot String 否 真实机器人消息数:针对人机协作场景
    robot_consult String 是 是否是机器人咨询会话 1是 0否
    robot_valid String 是 机器人有效会话:访客消息数>0 ,1是 0否
    robot_self String 是 机器人独立接待会话:未触发转人工的有效会话 1是 0否
    robot_valid_to_staff String 是 接待后转人工:触发转人工的有效会话, 1是 0否,robot_valid==1 and (robot_to_staff_active==1 or robot_to_staff_trigger==1)
    robot_valid_transfer_failed String 是 机器人有效会话转接失败:1是 0否,(robot_to_staff_active==1 or robot_to_staff_trigger==1) and trigger_to_staff_succ_flag!=1 and robot_valid==1
    robot_invalid String 是 机器人无效会话:1是 0否,(msg_visitor_to_robot==0 and msg_robot==0) or (robot_to_staff_trigger_key_word==1 and msg_visitor_to_robot==1)
    robot_of_visitor_direct_transfer String 是 直接转人工: 1是 0否, (robot_to_staff_active_box==1 and msg_visitor_to_robot==0) or (robot_to_staff_trigger_key_word==1 and msg_visitor_to_robot==1)
    robot_direct_transfer_failed String 是 直接转人工转接失败量:1是 0否,robot_direct_transfer==1 and trigger_to_staff_succ_flag==0
    robot_visitor_consult String 是 有效咨询机器人: 1是 0否,msg_visitor_to_robot>0
    snatch_forward_times String 是 抢接成功次数
    robot_to_staff_active String 是 客户主动点击转人工 1 是 0否 只要有一个主动类型操作就为1
    robot_to_staff_active_direct String 是 是否是直接回答转人工按钮触发 1 是 0否
    robot_to_staff_active_multiwheel String 是 是否是多轮问题转人工按钮触发 1 是 0否
    robot_to_staff_active_apprehend String 是 是否是理解回答转人工按钮触发 1 是 0否
    robot_to_staff_active_guide String 是 是否是引导回答转人工按钮触发 1 是 0否
    robot_to_staff_active_box String 是 是否是常驻转人工按钮触发 1 是 0否
    robot_to_staff_active_unknown String 是 是否是未知回答转人工按钮触发 1 是 0否
    robot_to_staff_active_feedback String 是 是否是客户点踩后转人工按钮触发 1 是 0否
    robot_to_staff_trigger String 是 客户触发自动转人工会话 1 是 0否 只要有一个被动触发类型操作就为1
    robot_to_staff_trigger_emotion String 是 是否是情绪负向触发转人工会话 1 是 0否
    robot_to_staff_trigger_repeated String 是 是否是连续重复提问触发转人工会话 1 是 0否
    robot_to_staff_trigger_key_word String 是 是否是设定关键词触发转人工会话 1 是 0否
    robot_to_staff_trigger_apprehend String 是 是否是理解回答触发转人工会话数 1 是 0否
    robot_to_staff_trigger_guide String 是 是否是引导回答触发转人工会话数 1 是 0否
    robot_to_staff_trigger_unknown String 是 是否是未知回答触发转人工会话数 1 是 0否
    source String 是 渠道,0 pc;1 微信;2 sdk APP;3 微博;4 移动网站H5;6 呼叫;7 工单中心;8 客户中心; 9 企业微信;10 微信小程序; 12 百度bcp; 13 头条;
    channel_flag String 否 子渠道ID
    channel_name String 否 子渠道名称
    ip String 否 ip地址
    os String 否 终端,1 Windows XP;2 Windows 7;3 Windows 8;4 Windows Vista;5 Windows 其他;6 Linux;7 macOS;8 Android;9 iOS;11 Windows 2000;12 Windows 10;其他 其他
    country_name String 否 国家
    province_name String 否 省份
    city_name String 否 城市
    human_transfer_timestamps String 否 转接时间点,单位毫秒,以英文逗号分隔;例如:1468827002400,1468826506677

    注:唯一主键 cid,各表通过 cid 关联,表示同一个会话

    请求参数:

    参数 类型 必填 描述
    sys_code String 是 产品编码,21
    type String 是 消息类型,conversation_v6
    content List 是 消息内容

    请求报文样例:

    {
      "sys_code": "21",
      "type": "conversation_v6",
      "content": [
        {
          "session_valid": "1",
          "channel_flag": "1",
          "robot_to_staff_active_direct": "0",
          "human_visitor_consult": "1",
          "last_robot_name": "小智机器人",
          "staffids": "a3b4860c55e2481c8c774dd789df2344",
          "robot_valid_transfer_failed": "0",
          "as_human_interactive_count": "1",
          "robot_consult": "1",
          "robot_names": "小智机器人",
          "visitorid": "9a6750652d414e04b8b810efe56bb762",
          "queue_type": "0",
          "ip": "1.202.171.178",
          "human_transfer": "0",
          "province_name": "北京",
          "msg_staff": "1",
          "first_staffid": "a3b4860c55e2481c8c774dd789df2344",
          "human_not_recep": "0",
          "total_duration": "15297",
          "human_recep_duration": "2835",
          "queue_interrupt": "0",
          "robot_to_staff_trigger_unknown": "0",
          "queue_not_accept": "1",
          "staff_valid_res_count": "0",
          "human_self": "0",
          "last_msg_staff": "1",
          "robot_to_staff_trigger_guide": "0",
          "human_leave_queue_duration": "0",
          "queue_start_time": "0",
          "robot_to_staff_active": "1",
          "robot_alias": "",
          "robot_valid": "1",
          "staff_res_duration_avg": "2835.0",
          "human_transfer_timestamps": "",
          "not_queue": "1",
          "offline_type": "2",
          "session_consult": "1",
          "robot_to_staff_active_feedback": "0",
          "visitor_first_msg_time": "1730894711020",
          "robot_to_staff_trigger_repeated": "0",
          "robot_valid_to_staff": "1",
          "last_staffid": "a3b4860c55e2481c8c774dd789df2344",
          "channel_name": "默认桌面网站",
          "queue_accept": "0",
          "session_invalid": "0",
          "human_valid_recep": "1",
          "robot_to_staff_active_box": "1",
          "max_response_duration": "2835",
          "robot_valid_transfer_succ": "1",
          "queue_leave": "0",
          "queue": "0",
          "human_invalid_recep": "0",
          "human_invalid": "0",
          "robot_to_staff_trigger": "0",
          "human_transfer_time_out": "0",
          "robot_to_staff_active_guide": "0",
          "last_staff_email": "quchaov6@zhichi.com",
          "human_snatch": "0",
          "source": "0",
          "session_recep_duration": "2851",
          "last_staff_name": "qc",
          "companyid": "e74d473e02d14192b8581fded92eca74",
          "staff_first_res60s_tag": "1",
          "first_receive_robotid": "1",
          "human_consult": "1",
          "last_groupid": "70f229d033be424085ce669883b93131",
          "msg_actual_robot": "1",
          "msg_total": "4",
          "msg_staff_word_count": "5",
          "robot_to_staff_trigger_apprehend": "0",
          "human_initiative": "0",
          "staff_first_res30s_tag": "1",
          "join_type": "3",
          "robot_of_visitor_direct_transfer": "0",
          "human_forward_times": "0",
          "robot_recep_duration": "16",
          "robotids": "1",
          "msg_visitor_to_robot": "1",
          "staff_first_res_duration": "2835",
          "robot_visitor_consult": "1",
          "robot_direct_transfer_succ": "0",
          "msg_robot": "1",
          "access_staff_time": "1730894711939",
          "first_group_name": "测试的",
          "human_accept_queue_duration": "0",
          "human_self_valid_recep": "0",
          "robot_to_staff_active_multiwheel": "0",
          "robot_to_staff_active_apprehend": "0",
          "chat_end_time": "1730894726036",
          "robot_to_staff_trigger_key_word": "0",
          "first_groupid": "70f229d033be424085ce669883b93131",
          "cid": "649f650822b141fa9c8420d580bf558e",
          "robot_to_staff_active_unknown": "0",
          "transfer_to_staff_succ_flag": "1",
          "msg_visitor_to_staff": "1",
          "robot_direct_transfer_failed": "0",
          "robot_self": "0",
          "snatch_forward_times": "0",
          "human_valid": "1",
          "trigger_to_staff_flag": "1",
          "city_name": "",
          "last_group_name": "测试的",
          "country_name": "中国",
          "first_receive_robot_name": "小智机器人",
          "first_staff_name": "qc",
          "chat_start_time": "1730894710739",
          "staff_res_total_duration": "2835",
          "human_consult_duration": "14097",
          "os": "5",
          "robot_invalid": "0",
          "staff_res_total_count": "1",
          "last_robotid": "1",
          "robot_to_staff_trigger_emotion": "0",
          "groupids": "70f229d033be424085ce669883b93131"
        }
      ]
    }
    
    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
    # ● 在线评价消息

    content 对象:

    参数 类型 必填 描述
    companyid String 是 公司 ID,适用一个公司多个超管帐号或者多个分公司需要分别统计的情况
    staffid String 是 客服 ID
    source String 是 用户来源:0 桌面网站、1 微信、2 App、3 微博、4 移动网站、6 呼叫、7 工单中心、8 客户中心、9 企业微信、10 小程序、12 百度营销、13 今日头条、14 奇虎360、15 阿里汇川、16 搜狗、17 微信客服、20 广点通、21 知乎、22 facebook、23 whatsApp、24 instagram、25 line、26 discord、33 telegram
    admin_name String 是 评价对象,可能是客服或机器人
    is_robot String 是 是否是机器人,1:是机器人、0:是人工客服
    remark String 是 备注信息
    tag String 否 评价标签
    score_flag String 是 0 5级评价,1 10级评价,2 2级评价
    score String 否 5 星评分,最高 5 星,均为正整数
    nps_score String 否 10分评分,最高 10 分,均为整数
    level2_score String 否 二级满意度,1分不满意,5分满意,均为整数
    visitorid String 否 访客 ID
    date_time String 是 时间,unixtime ms,例如 1539153409792
    cid String 是 会话ID,会话的唯一标识
    comment_type String 是 评价类型,0:邀请评价、1:主动评价
    solved String 是 标记是否解决,1:解决、0:未解决、-1:未开启
    groupid String 是 所属技能组ID
    group_name String 是 所属技能组名称

    注:唯一主键(cid+is_robot)

    请求参数:

    参数 类型 必填 描述
    sys_code String 是 产品编码,21
    type String 是 消息类型,evaluation
    content List 是 消息内容

    请求报文样例:

    {
        "sys_code":"21",
        "type":"evaluation",
        "content":[
            {
                "companyid":"5cc2c708202d4defaf72d4bcac362a55",
                "staffid":"9517",
                "source":"10",
                "admin_name":"",
                "is_robot":"1",
                "remark":"意向用户可跟",
                "tag":"答非所问,问题不能回答",
                "score_flag": "0",
                "score":"2",
                "visitorid":"97b31cba87e04dcdafe0ebb60248ecf4",
                "date_time":"1468340203266",
                "cid":"9ae05bc279544b68895cd86b12e418e0",
                "comment_type":"1",
                "solved":"1",
                "groupid": "4ae05bc279544b64595cd86b12e41y6u",
                "group_name": "历史组"
            }
        ]
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    # ● 在线访客信息

    content 对象:

    参数 类型 必填 描述
    companyid String 是 公司 ID,适用一个公司多个超管帐号或者多个分公司需要分别统计的情况。
    userid String 是 访客 ID
    img String 否 访客头像
    nick String 是 访客昵称
    source String 是 用户来源:0 桌面网站、1 微信、2 App、3 微博、4 移动网站、6 呼叫、7 工单中心、8 客户中心、9 企业微信、10 小程序、12 百度营销、13 今日头条、14 奇虎360、15 阿里汇川、16 搜狗、17 微信客服、20 广点通、21 知乎、22 facebook、23 whatsApp、24 instagram、25 line、26 discord、33 telegram
    enterprise_name String 否 公司名称,默认值为空字符串
    user_tels String 否 联系电话,如多个号码采用英文逗号","隔开
    user_emails String 否 电子邮箱,如多个邮箱采用英文逗号","隔开
    qq String 否 QQ号码
    partnerid String 否 合作方用户 ID
    user_name String 否 访客姓名
    province_name String 否 省份
    city_name String 否 市名称,默认值为空字符串
    area_name String 否 县/区名称,默认值为空字符串
    remark String 否 备注信息
    serviceid String 是 客服 ID,最后接待客服
    cid String 是 会话 ID
    params String 否 动态参数,jsonString:对接时由客户传过来
    summary_params String 否 服务总结相关参数,jsonString:对接由客户传过来
    service_no String 否 客服工号
    address String 否 地址

    注:唯一主键 userid

    请求参数:

    参数 类型 必填 描述
    sys_code String 是 产品编码,21
    type String 是 消息类型,user
    content List 是 消息内容

    请求报文样例:

    {
        "type":"user",
        "sys_code":"21",
        "content":[
            {
                "companyid":"5cc2c708202d4defaf72d4bcac362a55",
                "userid":"837213545777846",
                "img":"https://img.sobot.com/console/common/face/user.png", 
                "nick":"招商王", 
                "source":"10", 
                "enterprise_name":"",
                "user_tels":"13545777846",
                "user_emails":"506003007@qq.com",
                "qq":"784383358",
                "partnerid":"13545777846",
                "user_name":"孙盼",
                "province_name":"山东", 
                "city_name":"", 
                "area_name":"",
                "remark":"",
                "params":{
                    "KUID":"MTU2NjY0MzE1NTAwMDA3MTAz",
                    "cookie":"88a484e052f1455a8706213cd41c4c94"
                },
                "serviceid":"ea6f8d1a5e8846fd8dfce4ab7057c45c", 
                "cid":"86937e82ae244ad59aeefe41af731079",
                "service_no":"11123",
                "address": "中国/山东/青岛"
            }
        ]
    }
    
    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
    # ● 在线客户信息

    content 对象:

    参数 类型 必填 描述
    companyid String 是 公司 ID,适用一个公司多个超管帐号或者多个分公司需要分别统计的情况
    userid String 是 用户 ID
    img String 是 用户头像
    nick String 否 用户昵称
    source String 是 用户来源:0 桌面网站、1 微信、2 App、3 微博、4 移动网站、6 呼叫、7 工单中心、8 客户中心、9 企业微信、10 小程序、12 百度营销、13 今日头条、14 奇虎360、15 阿里汇川、16 搜狗、17 微信客服、20 广点通、21 知乎、22 facebook、23 whatsApp、24 instagram、25 line、26 discord、33 telegram
    enterprise_name String 是 公司名称,默认值为空字符串
    user_tels String 否 用户联系电话,默认值为空字符串
    user_emails String 否 用户邮箱,默认值为空字符串,此参数可能会采用英文逗号","隔开
    user_name String 否 用户真实姓名,默认值为空字符串
    qq String 否 用户QQ,默认值为空字符串
    country_name String 否 国家
    province_name String 是 省份
    city_name String 否 市名称,默认值为空字符串
    area_name String 否 县/区名称,默认值为空字符串
    remark String 否 备注,默认值为空字符串
    visitorids String 否 访客ID,默认值为空字符串
    service_no String 否 客服工号,默认值为空字符串
    serviceid String 是 客服ID
    cid String 是 会话ID
    result_list List 否 自定义字段

    注:唯一主键 userid

    请求参数:

    参数 类型 必填 描述
    sys_code String 是 产品编码,21
    type String 是 消息类型,userinfo
    content List 是 消息内容

    请求报文样例:

    {
        "sys_code":"21",
        "type":"userinfo",
        "content":[
            {
                "companyid":"5cc2c708202d4defaf72d4bcac362a55",
                "userid":"837213545777846",
                "img":"https://img.sobot.com/console/common/face/user.png",
                "nick":"招商王",
                "source":"10",
                "country_name":"美国",
                "enterprise_name":"",
                "user_tels":"13545777846",
                "user_emails":"13545777846@foxmail.com",
                "user_name":"孙盼",
                "province_name":"加利福尼亚州",
                "city_name":"洛杉矶",
                "area_name":"",
                "remark":"意向用户可跟",
                "visitorids":"",
                "service_no":"1011",
                "serviceid":"ea6f8d1a5e8846fd8dfce4ab7057c45c",
                "cid":"bcfb6853edc446c0a4305692b9daf6c8",
                "result_list":[
    
                ]
            }
        ]
    }
    
    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
    # ● 在线聊天消息

    content 对象:

    参数 类型 必填 描述
    companyid String 是 公司 ID,适用一个公司多个超管帐号或者多个分公司需要分别统计的情况
    cid String 是 会话 ID
    format_time String 否 时间,格式:yyyy-MM-dd HH:mm:ss
    timems String 是 时间戳,unixtime ms,例如:1539153409792
    senderid String 是 发送人ID,为访客 ID 或客服 ID 或机器人 ID
    sender_name String 否 发送人
    receiverid String 否 接收人 ID,为访客 ID 或客服 ID 或机器人 ID
    receiver_name String 否 接收人
    msg String 否 聊天内容
    docid string 否 问题 id,知识库问题的 id 只有sender_type=1 的消息有
    doc_name string 否 词条名称,知识库问题的词条名称 只有 sender_type=1 的消息有
    sender_type String 否 发送方类型,0:访客、1:机器人、2:人工客服
    receiver_type String 否 接收方类型,0:访客、1:机器人、2:人工客服、3:无接收方(表示该消息为留言转离线消息)
    msg_offline String 是 是否是离线消息,1:是、0:否
    msgid String 否 消息唯一ID
    revoke_flag String 否 非聊天内容数据,撤回消息:1 ,此字段与 sender_type,receiver_type为互斥关系

    注: 唯一主键 msgid

    请求参数:

    参数 类型 必填 描述
    sys_code String 是 产品编码,21
    type String 是 消息类型,msg
    content List 是 消息内容

    请求报文样例:

    聊天内容:

    {
        "sys_code":"21",
        "type":"msg",
        "content":[
            {
                "companyid":"5cc2c708202sasad2f72d4bcac362a55",
                "cid":"44c603626e2e4c82a5a49619a8aaa397",
                "format_time":"2017-11-01 12:24:04",
                "timems":"1509510244000",
                "senderid":"33c603626e434c82a5a49619aadde451",
                "sender_name":"冯建武",
                "receiverid":"25e603626e434c82a5a49619aaqw345",
                "receiver_name":"胡丽静",
                "msg":"到还款日,延期3天怎么算",
                "docid":"88c5342f51134db58ea59f430ad16939",
                "doc_name":"来张图片",
                "sender_type":"0",
                "receiver_type":"2",
                "msg_offline":"0",
                "msgid": "dcc2c708202safad2f72d4bcac382a09"
            }
        ]
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23

    撤回消息:

    {
        "sys_code": "21",
        "type": "msg",
        "content": [
            {
                "companyid": "96804ad241f648079606cad5d28ca67b",
                "senderid": "cd29b1a1751a495a824befcbf38ae909",
                "revoke_flag": "1",
                "msg_offline": "0",
                "cid": "e874dee1eecd43b0bd545161508ecec9",
                "timems": "1709537028479"
            }
        ]
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    # ● 在线服务总结

    content 对象:

    参数 类型 必填 描述
    companyid String 是 企业 ID,适用一个公司多个超管帐号或者多个分公司需要分别统计的情况
    cid String 是 会话 ID
    visitorid String 是 访客 ID
    operationid String 是 业务单元 ID
    operation_name String 是 业务单元名称
    req_type String 是 业务类型 ID 列表,以 "- 隔开
    req_type_name String 是 业务类型名称列表,以 "-" 隔开
    summary_status String 是 处理状态,1:已解决、0:未解决、-1:未勾选
    summary_description String 是 备注
    update_time String 是 更新时间,例如:"1577785628084"
    update_staffId String 是 更新人 ID
    invalid_flag String 是 服务总结状态,1:无效会话、0: 有效会话
    update_staff_name String 是 编辑服务总结内容客服名称
    groupid String 是 技能组 ID
    group_name String 是 技能组名称
    fieldid List<String> 否 自定义字段 id 列表
    field_name List<String> 否 自定义字段名称
    field_value List<String> 否 自定义字段值
    start_time String 否 会话建立时间
    summary_classify_names String 否 服务分类
    summary_classify_paths String 否 服务分类路径
    summary_classify_codes String 否 服务分类编码
    summary_template_name String 否 服务模板
    summary_handle_progress String 否 处理进度值
    summary_handle_progress_name String 否 处理进度名称
    summary_remark String 否 备注
    customer_fields List<Object> 否 自定义字段

    customer_fields:

    参数 类型 必填 描述
    field_name String 否 自定义字段名称
    field_value String 否 自定义字段值
    fieldid String 否 自定义字段ID
    field_text String 否 自定义字段具体文案

    注:唯一主键 cid+update_time

    请求参数:

    参数 类型 必填 描述
    sys_code String 是 产品编码,21
    type String 是 消息类型,summary
    content List 是 消息内容

    请求报文样例:

    {
        "sys_code":"21",
        "type":"summary",
        "content":[
            {
                "chat_start_time":"1577779079941",
                "group_name":"test",
                "groupid":"ab900e0cea3f4247981631a7bdb0c694",
                "summary_status":"1",
                "field_name":[
                    "字段1",
                    "字段2"
                ],
                "operation_name":"",
                "update_staff_name":"毛怪",
                "companyid":"7f72b9c5dee8425fba152a216e528cd4",
                "update_time":"1577779099437",
                "invalid_flag":"0",
                "operationid":"1577330071201",
                "field_value":[
                    "qweqeqw",
                    "eqweqwe"
                ],
                "req_type_name":"手机-电脑",
                "req_type":"1577330173970-1577330182339",
                "update_staffId":"132dd5ef52b44dc3931f181980c61276",
                "cid":"dfdc8f4dfaab44bbb463a5f8960a4cc7",
                "visitorid":"d7a05991e58c35f1dede477a04205f92",
                "summary_description":"qeqe",
                "fieldid":[
                    "3fc247578a294a3297a7418d521974fd",
                    "39303cc831c641ad93a5f0757cce69d7"
                ],
                "summary_classify_names": "test_class_name",
                "summary_classify_paths": "test_class_paths",
                "summary_classify_codes": "test_class_codes",
                "summary_template_name": "testclasstemplate",
                "summary_handle_progress": "1",
                "summary_handle_progress_name": "testprogressname",
                "summary_remark": "test_sumary_remark",
                "customer_fields": [{
                  "field_name": "是否需要回访",
                  "field_value": "自定义字段",
                  "fieldid": "1733dc105d9c4862b51793fb2f90e76d",
                  "field_text": "perfect"
                }]
            }
        ]
    }
    
    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
    # ● 消息转发加密

    基于在线消息转发接口,智齿提供加密功能。

    加密条件:

    需要联系智齿对应支撑人员,在智齿统一的业务支撑管理系统中开启加密设置项(先提供消息接收地址),并获取智齿提供的密钥进行解密操作,开启设置项后当晚 12:00 之后开始进行消息主动推送

    加密方式:

    采用 AES 加密

    加密范围:

    开启加密设置项后,目前支持的加密范围:

    • 在线消息: type 类型为 user,userinfo,msg,evaluation,summary,conversation, 加密内容为 content 字段整体。
    • 工单消息:type 类型为 ticket, 加密内容为 content 字段整体。
    • 通话记录: type 类型为 calllog, 加密内容为 content 数组中的每一条数据。

    加密数据示例:

    user 类型

    {
        "type":"user",
        "sys_code":"21",
        "content": " 0PKeYX9heDTiqE8Bi+sFBO9Id1OUvJCw9Okk0j9D/qhKvUyH2wbb61ggyCpO4czYzFvi0S0rrGuMTyYzr5mfwdcnq3nbG8QaZSzHDa3KbFcfF4QGPKU8NU5BvIv6EyU3Ul6KeZ3+ITG6jCD8MxqGE/WcIF1+t213iS1kEyz32TCLXsrrVpFRwz5oMRosaqjuLaofXCKSVSJbo3+/a+I7RQXDM+BYaLAyKn6dyYMTfbEnLCQCx+unkr2KPy2bnr03vGLdYPvNjusXuqitJb1YgToSqw/BfMOtwEjSrjlImtIGpnDtk7yrqxdbf4vF8Q5pPCuMJ65o8z6lwmceznXi/ZHpmDOc4LhSxNF5w5yUlCyjAGFgqe9VzpjsBjHhbNIAKZlMXMI6c5Z3S4p0nDKLfBXZum3PK7A1miyFpqlGbO6MURpU2HF8G3ZJL2woDaWbSrmFMNxjLH8h8KOZTOcYgr9/ptbeHjrA3bIsVDRa8hQ="
    }
    
    1
    2
    3
    4
    5

    calllog 类型

    {
        "type":"calllog",
        "content": [
         "0PKeYX9heDTiqE8Bi+sFBO9Id1OUvJCw9Okk0j9DITG6jCD8MxqGEBvIv6EyU3Ul6KeZ3",
         "qhKvUyH2wbb61ggyCpO4czYzFvi0S0rrGuMTyYzr5mfwdcnq3nbG8QaZSzHDa3KbFcfFT"
        ]
    }
    
    1
    2
    3
    4
    5
    6
    7

    解密代码示例

    • content 字段整体加密, 解密代码示例(使用Java语言):
    • 需要引入的pom依赖
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.12.0</version>
        </dependency>
    
    1
    2
    3
    4
    5

    代码:

    import org.apache.commons.lang3.StringUtils;
    
    import javax.crypto.Cipher;
    import javax.crypto.spec.IvParameterSpec;
    import javax.crypto.spec.SecretKeySpec;
    import java.util.Base64;
    
    public class AESEncrypt {
    
        /**
         * DES 解密方法
         *
         * @param data 需要解密的密文
         * @param key  解密使用的 key
         * @return
         */
        public static String desEncrypt(String data, String key) {
            int subLength = 16 - key.length();
            if (subLength >= 0) {
                key = StringUtils.join(key, StringUtils.substring(key, 0, subLength));
            }
            String ivString = key;
            byte[] iv = ivString.getBytes();
            try {
                byte[] encryp = Base64.getDecoder().decode(data);
                Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding");
                SecretKeySpec keySpec = new SecretKeySpec(key.getBytes(), "AES");
                IvParameterSpec ivSpec = new IvParameterSpec(iv);
                cipher.init(Cipher.DECRYPT_MODE, keySpec, ivSpec);
                byte[] original = cipher.doFinal(encryp);
                return new String(original);
            } catch (Exception e) {
                e.printStackTrace();
                return null;
            }
    
        }
    }
    
    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
    • content 数组中每条数据单独加密, 解密代码示例(使用Java语言):
        /**
         * DES 解密方法
         * @param content 密文
         * @param key 加解密使用的key
         * @return String 明文
         */
        public static String dcodes(String content, String key) {
            if (content == null || content.length() < 1) {
                return null;
            }
            if (content.trim().length() < 19) {
                return content;
            }
            byte[] byteRresult = new byte[content.length() / 2];
            for (int i = 0; i < content.length() / 2; i++) {
                int high = Integer.parseInt(content.substring(i * 2, i * 2 + 1), 16);
                int low = Integer.parseInt(content.substring(i * 2 + 1, i * 2 + 2), 16);
                byteRresult[i] = (byte) (high * 16 + low);
            }
            try {
                KeyGenerator kgen = KeyGenerator.getInstance("AES");
                SecureRandom random=SecureRandom.getInstance("SHA1PRNG");
                random.setSeed(key.getBytes());
                kgen.init(128, random);
                SecretKey secretKey = kgen.generateKey();
                byte[] enCodeFormat = secretKey.getEncoded();
                SecretKeySpec secretKeySpec = new SecretKeySpec(enCodeFormat, "AES");
                Cipher cipher = Cipher.getInstance("AES");
                cipher.init(Cipher.DECRYPT_MODE, secretKeySpec);
                byte[] result = cipher.doFinal(byteRresult);
                return new String(result);
            } catch (NoSuchAlgorithmException e) {
                e.printStackTrace();
            } catch (NoSuchPaddingException e) {
                e.printStackTrace();
            } catch (InvalidKeyException e) {
                e.printStackTrace();
            } catch (IllegalBlockSizeException e) {
                e.printStackTrace();
            } catch (BadPaddingException e) {
                e.printStackTrace();
            }
            return null;
        }
    
    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
    上次更新: 2025/2/6 14:24:02

    ← 消息推送 知识库V6 API→

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