Developer Documentation Developer Documentation
Help Center (opens new window)
Help Center (opens new window)
  • Channel Access

    • Web Link Access Description
    • Web-JS Access Description
    • Android SDK
    • iOS SDK
    • WeChat Mini Program
    • Flutter、DCloud、APICloud
    • CRM Docking Scheme
  • Live Chat API
  • Chatbot API
  • Agent Component SDK

  • Message Push
  • Online Message Forwarding API
    • Knowledge Base V6 API
    • Chatbot Statistics API
    • Enterprise actively sends offline message API
    • Rule Engine API
    • AI Agent API
    • Text Product API
    Sobot
    2022-05-19
    Menus

    Online Message Forwarding API

    # Online Message Forwarding API

    # Online Message Forwarding

    For this function, the message format is Json . The configuration of real-time message push is updated once every 30 minutes. For data of the same type in the same company, 20 pieces of data are cached and packaged for one-time sending; in case of less than 20 pieces, data are packaged and sent once per second.

    Real-time message push requires customer to provide a data receiving API, such as https://xxxxxxxx.xxxxxx.io/sobot/message. All types of data use the same URL.

    The message forwarding API can be encrypted before passing. You can contact your customer manager to enable the setting. After enabling, you can add three parameters in the header upon message forwarding: timestamp (server time), random code, and sign (MD5 encryption, 32-bit lowercase). After getting the parameters, customer will decode and compare them to correctly receive the data; in case of error, an error code will be returned.

    Parameters in header:

    Param Type Required Description
    X-Log-TimeStamp String Timestamp (server time: ms)
    X-Log-RandomCode String Random code
    X-Log-Sign String sign signature, concatenate the strings of companyId, timestamp (server time), random code, appKey (key used to configure message forwarding) in sequence, and use the MD5 digest algorithm (32-bit lowercase) to get the value

    Request example:

    curl  https://xxxxxxx.xxxxxx.io/sobot/message
    -X POST 
    -H 'X-Log-TimeStamp: 1609224926723'
    -H 'X-Log-RandomCode: 635'
    -H 'X-Log-Sign: 9ba80f40bc5e6fd404648ea15aa4f7fa'
    
    1
    2
    3
    4
    5
    # ● Online Chat Message(Deprecated)

    content object:

    Param Type Required Description
    companyid String Yes Company ID, applicable to separate statistics on a company with multiple super admin accounts or multiple branches
    cid String Yes Chat ID
    source String Yes User sources:0 PC,1 WeChat,2 SDK,3 Weibo,4 Mobile site,6 call center,7 ticket center,8 customer center,9 WeCom,10 WeChat mini program,12 baidu,13 toutiao,14 360,15 Alibaba Huichuan,16 Sogou,17 WeChat customer service,20 Guangdian Tong,21 Zhihu,22 facebook,23 whatsApp,24 instagram,25 line,26 discord,33 telegram
    start_time String Yes Start time, unixtime ms, e.g.: "1539153409792"
    end_time String Yes End time, unixtime ms, e.g.: "1539153409792"
    first_response_time String Yes 1st Response Time, unixtime ms, e.g.: "1539153409792"
    transfer_tohuman_time String Yes Bot-agent transfer time, unixtime ms, e.g.: "1539153409792"
    conversation_duration String Yes Chat duration, ms
    staff_emails String Yes Last reception agent email
    staff_name String Yes Last reception agent name
    consult_robot_msg_count String Yes Bot Inquiry Messages
    robot_reply_msg_count String Yes Bot Replies
    consult_staff_msg_count String Yes Agent Inquiry Messages
    staff_reply_msg_count String Yes Agent Replies
    transfer_human_succ_flag String Yes Whether trans-to-agent succeeded, 1-YES; 0-NO
    queue_time String Yes Queue duration, ms
    session_queue_state String Yes Queue status, 1: Queue not connected, 2: Queuing, 3: Queue leaving
    ip String Yes Visit IP, format: "255.255.255.255"
    area String Yes Region
    os String Yes Terminal, 1: Windows XP; 2: Windows 7; 3: Windows 8; 4: Windows Vista; 5: Other Windows version; 6: Linux; 7: macOS; 8: Android; 9: iOS; 11: Windows 2000; 12: Windows 10; Other: Other
    visitorid String Yes User ID
    partnerid String Yes Partner user ID
    lastgroupid String Yes Last reception agent group ID
    lastgroup_name String Yes Last reception agent group name
    offline_type String Yes Chat end method: 1: Agent offline, 2: Customer removed by agent, 3: Customer blacklisted by agent, 4: Customer chat timeout, 5: Customer closed chat page, 6: Customer opened a new page
    human_valid_flag String Yes Whether it's a valid agent chat, 1: YES, 0: NO
    human_invalid_flag String Yes Whether it's an invalid agent chat, 1: YES, 0: NO
    human_invalid_recep_flag String Yes Whether it's an invalid agent reception, 1: YES, 0: NO
    human_valid_recep_flag String Yes Whether it's a valid agent reception, 1: YES, 0: NO
    human_recep_flag String Yes Whether it's an agent reception, 1: YES, 0: NO
    robot_invalid_flag String Yes Whether it's an invalid bot chat, 1: YES, 0: NO
    robot_valid_flag String Yes Whether it's a valid bot chat, 1: YES, 0: NO
    province_name String Yes Province name
    city_name String Yes City name
    access_human_time String Yes Agent access time
    robotid String No Bot ID
    robot_alias String No Bot alias, the bot docking param, prior to robotid . Currently it only supports APP channel
    robot_name String No Bot nickname
    staffids String No All reception agent IDs, separated by ",";
    invite_evaluation_flags String No Whether agent has invited for evaluation, corresponding to the sequence of reception agent IDs, 1: Invited, 0: Not invited
    response_duration Long Yes Total response duration: ms
    response_count Int Yes Total no. of response
    response_avg String Yes Avg. response time = total response duration / total no. of response
    session_human_duration String Yes Agent Reception Time
    asHuman_interactive_count String Yes Agent interactive chats
    channel_flag String Yes Sub-channel ID
    channel_name String Yes Sub-channel name
    search_engine String No Search source: 1: Baidu natural search, 2: Baidu paid search, 3: 360 search, 4: sougou, 5: Shenma, 6: Bing, 7: Google, 8: other search engines, 9: direct access, 10: external links, 11: Baidu unknown access
    land_page_url String No Landing page URL
    land_page_title String No Landing page title
    conversation_page_url String No Chat initiation page URL
    conversation_page_title String No Chat initiation page title
    search_word String No Search term
    lastrobotid String No Final Receptionist Robot ID
    lastrobot_name String No Final Receptionist Robot Name
    human_transfer_timestamps String No The transfer time points, in milliseconds, separated by commas;such as:1468827002400,1468826506677

    Note: The unique primary key is cid . All tables are associated via cid, indicating a same chat

    Request param:

    Param Type Required Description
    sys_code String Yes Product code, 21
    type String Yes Message type, conversation
    content List Yes Message Content

    Sample request message:

    { 
      "sys_code":"21",
        "type":"conversation",
        "content":[
            {
                "companyid":"5cc2c708202d4defaf72d4bcac362a55",
                "cid":"86937e82ae244ad59aeefe41af731079",
                "source":"2",
                "start_time":"1468826506677",
                "partnerid":"1907281202433341",
                "end_time":"1468827002400",
                "first_response_time":"1468827002400",
                "transfer_tohuman_time":"1468826506677",
                "conversation_duration":"495723",
                "staff_emails":"11122221@foxmail.com",
                "staff_name":"admin01",
                "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":"118.0.1.1",
                "area":"Liaoning",
                "os":"8",
                "visitorid":"837213545777846",
                "lastgroupid":"35980200f279438b952f8dc3d5731f85",
                "lastgroup_name":"Customer service group",
                "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": "1234",
                "robot_alias": "test_alias",
                "robot_name": "Robot Xiaoming",
                "staffids":"3695089d031c409380073081aaa73c7d,733e9edabb5c4158b095198aec58a890,3ff11cb243b540f78f8274f84b289920",
                "invite_evaluation_flags":"0,1,1",
                "channel_flag": "d720fe0e97ac427183c65b59f82c061f",
                "channel_name": "Android - official",
                "response_duration": "0",
                "response_count": "0",
                "response_avg": "0",
                "session_human_duration": "0",
                "asHuman_interactive_count": "0",
                "search_engine": "1",
                "land_page_url": "http://sg.sobot.io",
                "land_page_title": "[official website] sobot - | sobot customer service online customer service system of science and technology Cloud call center Intelligent service robot Smart to call",
                "conversation_page_url": "http://sg.sobot.io", 
                "conversation_page_title": "[official website] sobot - | sobot customer service online customer service system of science and technology Cloud call center Intelligent service robot Smart to call",
                "search_word": "service",
                "lastrobotid": "1",
                "lastrobot_name":"Anda",
                "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
    # ● Online Chat Message V6

    content object:

    Param Type Required Description
    companyid String Yes Company ID, applicable to separate statistics on a company with multiple super admin accounts or multiple branches
    trigger_to_staff_flag String Yes Whether to trigger the transfer to manual service: 1 Yes, 0 No
    transfer_to_staff_succ_flag String Yes Whether the transfer to manual service is successful: 1 Yes, 0 No
    access_staff_time String No Timestamp of connecting to manual service,such as:1704168121000
    cid String Yes the session ID
    chat_start_time String Yes The start time of the conversation,such as: 1704168121000
    chat_end_time String Yes The end time of the conversation,such as: 1704168121000
    human_consult String Yes Whether it is a manual consultation session: 1 Yes,0 No
    human_self String Yes Whether it is a manual independent reception(Only calculate the sessions that have not undergone transfer, excluding those received by the robot.):1 Yes,0 No
    human_transfer String Yes Transfer sessions, excluding timeout transfers: 1 Yes,0 No
    human_transfer_time_out String Yes Whether it is a timeout transfer: 1 Yes,0 No
    human_snatch String Yes Whether it is a session snatched for reception:1 Yes,0 No
    human_valid String Yes Whether it is a valid manual session: 1 Yes,0 No
    human_valid_recep String Yes Whether it is a valid manual reception: 1 Yes,0 No
    human_invalid String Yes Whether it is an invalid manual session: 1 Yes,0 No
    human_invalid_recep String Yes Whether it is an invalid manual reception session:1 Yes,0 No
    human_not_recep String Yes Whether it is not received by a human: 1 Yes,0 No
    human_initiative String No Whether the session was initiated by active invitation,Only calculate the manual customer service accessed for the first time:1 Yes,0 No
    queue_start_time String No Queue start time,such as:1704168121000
    queue String Yes Whether it is a queuing session,Only calculate the manual one accessed for the first time: 1 Yes,0 No
    not_queue String Yes Whether it is a non-queuing session,Only calculate the manual one accessed for the first time: 1 Yes,0 No
    queue_not_accecpt String Yes Whether it is unqueued and connected,Only calculate the manual one accessed for the first time: 1 Yes,0 No
    queue_accept String Yes Whether it is a queued and connected session: 1 Yes,0 No
    queue_interrupt String Yes Whether it is a queuing interruption: 1 Yes,0 No
    human_accept_queue_duration String No Queuing connection duration,Only calculate the first customer service,Unit: Millisecond,such as:80909
    queue_leave String Yes Queue leaving session: 1 Yes,0 No
    human_leave_queue_duration String No Queue leaving duration,Unit: Millisecond,such as:80909
    msg_visitor_to_staff String No The number of messages sent by the customer to the staff
    msg_staff String No The number of messages of the staff
    msg_total String No Total number of messages=msg_robot+msg_visitor_to_robot+msg_staff+msg_visitor_to_staff
    msg_staff_word_count String No The number of characters sent by the customer service
    human_forward_times String No The number of successful clicks for manual transfer
    staff_first_res_duration String No First response duration,Only calculate after the customer sends the first message,Unit: Millisecond,such as:50603
    staff_first_res60s_tag String No First response mark within 60 seconds: 1 Yes,0 No
    staff_first_res30s_tag String No First response mark within 30 seconds: 1 Yes,0 No
    staff_res_total_duration String No Total response duration,Unit: Millisecond,such as:111909
    staff_valid_res_count String No The number of effective manual interactions,The complete conversation turns between the customer service and the visitor>=2
    staff_res_total_count String No Total response times
    max_response_duration String No Maximum response duration,Unit: Millisecond,such as:111909
    staff_res_duration_avg String No Average manual response duration,Unit: Millisecond,such as:80909
    human_recep_duration String No Manual reception duration,Unit: Millisecond,such as:80909
    last_msg_staff String Yes The session mark where the last message is from the customer service:1 Yes,0 No
    human_self_valid_recep String Yes Manual independent and effective reception:1 Yes,0 No,human_self==1 && human_valid_recep==1
    human_consult_duration String Yes Duration of accessing manual consultation=chat_end_time - access_staff_time,Unit: Millisecond,such as:80909
    human_visitor_consult String Yes Whether it is a valid manual consultation:1 Yes,0 No, msg_visitor_to_staff>0
    queue_type String No Queuing type: 1-vip,2-Specified priority,3-Ordinary customers transferred to priority,0-Ordinary queuing,-1-Queue priority is not enabled
    last_staffid String No Last received customer service ID
    last_staff_name String No Last received customer service name
    groupids String No Participating skill group ID,Separated by English commas
    last_groupid String No Last received skill group Id
    last_group_name String No The name of the last received skill group
    visitorid String Yes Visitor ID
    first_staffid String No First received customer service Id
    first_staff_name String No The name of the first received customer service
    first_groupid String No The Id of the first received skill group
    first_group_name String No The name of the first received skill group
    offline_type String No Session ending method: 1 Customer service offline,2 Kicked offline actively by the customer service, 3 The customer was added to the blacklist ,4 The customer was offline due to timeout ,5 The customer actively logged off
    as_human_interactive_count String No Number of manual interaction sessions
    last_staff_email String No Last customer service email
    session_consult String Yes Total consultation sessions:1 Yes,0 No
    robot_recep_duration String No Duration of robot reception,Unit: Millisecond,such as:80909
    session_recep_duration String No Total reception duration=robot_recep_duration+human_recep_duration,Unit: Millisecond,such as:80909
    human_recep_duration String No Manual reception duration,Unit: Millisecond,such as:80909
    total_duration String Yes Total duration=chat_end_time - chat_start_time,Unit: Millisecond,such as:152352
    session_invalid String Yes Total invalid sessions:1 Yes,0 No
    session_valid String Yes Total valid sessions:1 Yes,0 No
    visitor_first_msg_time String Yes Visitor's first consultation time,Unit: Millisecond,such as: 1704128521000
    robot_valid_transfer_succ String Yes The successful transfer to manual service triggered by the valid session of the robot: 1 Yes,0 No;trigger_to_staff_flag==1 && robot_valid==1
    join_type String No Access type: 1 Only robot, 2 Only staff, 3.Robot priority , 4 Manual service priority
    robot_direct_transfer_succ String Yes Direct transfer to manual service succeeded: 1 Yes, 0 No;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 No Participating robot ID,Separated by commas
    robot_names String No Participating robot name,Separated by commas
    first_receive_robotid String No First-receiving robot ID
    first_receive_robot_name String No First-receiving robot name
    last_robotid String No Last-receiving robot ID
    last_robot_name String No Last-receiving robot name
    robot_alias String No Robot alias,Docking parameters
    staffids String No Participating manual customer service,Separated by commas
    msg_visitor_to_robot String No The number of messages from visitors to the robot
    msg_robot String No The number of robot messages
    msg_actual_robot String No The number of real robot messages,For the human-machine collaboration scenario
    robot_consult String Yes Whether it is a robot consultation session: 1 Yes, 0 No
    robot_valid String Yes Effective robot sessions(The number of visitor messages>0): 1 Yes, 0 No
    robot_self String Yes Robot independent reception session:Valid sessions that did not trigger the transfer to human: 1 Yes, 0 No
    robot_valid_to_staff String Yes Transfer to human after robot reception(Valid sessions that triggered the transfer to human): 1 Yes, 0 No,robot_valid==1 and (robot_to_staff_active==1 or robot_to_staff_trigger==1)
    robot_valid_transfer_failed String Yes The transfer of valid robot sessions failed:1 Yes, 0 No,(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 Yes Invalid robot sessions:1 Yes, 0 No.(_==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 Yes The robot directly transfers to human: 1 Yes, 0 No. (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_falid String Yes The failure quantity of the robot's direct transfer to human:1 Yes, 0 No. robot_direct_transfer==1 and trigger_to_staff_succ_flag==0
    robot_visitor_consult String Yes Effective consulting robot: 1 Yes, 0 No. msg_visitor_to_robot>0
    snatch_forward_times String Yes The number of successful grabs
    robot_to_staff_active String Yes Customers actively click to transfer to human: 1 Yes, 0 No. As long as there is one active type of operation, it is 1
    robot_to_staff_active_direct String Yes Whether it is triggered by directly answering the transfer to human button: 1 Yes ,0 No
    robot_to_staff_active_multiwheel String Yes Whether it is triggered by the transfer to human button of multi-round questions: 1 Yes, 0 No
    robot_to_staff_active_apprehend String Yes Whether it is triggered by the transfer to human button of understanding the answer: 1 Yes, 0 No
    robot_to_staff_active_guide String Yes Whether it is triggered by the transfer to human button of guided answers: 1 Yes, 0 No
    robot_to_staff_active_box String Yes Whether it is triggered by the permanent transfer to human button: 1 Yes, 0 No
    robot_to_staff_active_unknown String Yes Whether it is triggered by the transfer to human button for unknown answers: 1 Yes, 0 No
    robot_to_staff_active_feedback String Yes Whether it is triggered by the transfer to human button after the customer gives a dislike: 1 Yes, 0 No
    robot_to_staff_trigger String Yes The customer triggers the automatic transfer to human session: 1 Yes, 0 No. As long as there is one passive trigger type operation, it is 1
    robot_to_staff_trigger_emotion String Yes Whether it is triggered by negative emotion to transfer to human session: 1 Yes, 0 No
    robot_to_staff_trigger_repeated String Yes Whether it is triggered by continuous repetitive questioning to transfer to human session: 1 Yes, 0 No
    robot_to_staff_trigger_key_word String Yes Whether it is triggered by setting keywords to transfer to human session: 1 Yes, 0 No
    robot_to_staff_trigger_apprehend String Yes Whether it is triggered by understanding the answer to transfer to the number of human sessions: 1 Yes, 0 No
    robot_to_staff_trigger_guide String Yes Whether it is triggered by the guided answer to transfer to the number of human sessions: 1 Yes, 0 No
    robot_to_staff_trigger_unknown String Yes Whether it is triggered by the unknown answer to transfer to the number of human sessions: 1 Yes, 0 No
    source String Yes source: 0 pc,1 WeChat,2 sdk APP,3 Weibo,4 Mobile website H5, 6 call, 7 Work Order Center,8 Customer Center, 9 Enterprise WeChat,10 WeChat Mini Program, 12 Baidu BCP, 13 Toutiao
    channel_flag String No Sub-channel ID
    channel_name String No Sub-channel Name
    ip String No IP address
    os String No os:1 Windows XP,2 Windows 7,3 Windows 8,4 Windows Vista ,5 Windows others,6 Linux,7 macOS,8 Android,9 iOS,11 Windows 2000,12 Windows 10,other other
    country_name String No Country Name
    province_name String No Province Name
    city_name String No City Name
    human_transfer_timestamps String No Transfer time point,Unit: millisecond,Separated by commas;such as:1468827002400,1468826506677

    Request param:

    Param Type Required Description
    sys_code String Yes Product code, 21
    type String Yes Message type, conversation_v6
    content List Yes Message Content

    Sample request message:

    {
     "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": "smart robot",
       "staffids": "a3b4860c55e2481c8c774dd789df2344",
       "robot_valid_transfer_failed": "0",
       "as_human_interactive_count": "1",
       "robot_consult": "1",
       "robot_names": "smart robot",
       "visitorid": "9a6750652d414e04b8b810efe56bb762",
       "queue_type": "0",
       "ip": "1.202.171.178",
       "human_transfer": "0",
       "province_name": "Beijing",
       "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": "pc",
       "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": "test",
       "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_falid": "0",
       "robot_self": "0",
       "snatch_forward_times": "0",
       "human_valid": "1",
       "trigger_to_staff_flag": "1",
       "city_name": "",
       "last_group_name": "test",
       "country_name": "China",
       "first_receive_robot_name": "smart robot",
       "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
    # ● Online Evaluation Message

    content object:

    Param Type Required Description
    companyid String Yes Company ID, applicable to separate statistics on a company with multiple super admin accounts or multiple branches
    staffid String Yes Agent ID
    source String Yes User sources:0 PC,1 WeChat,2 SDK,3 Weibo,4 Mobile site,6 call center,7 ticket center,8 customer center,9 WeCom,10 WeChat mini program,12 baidu,13 toutiao,14 360,15 Alibaba Huichuan,16 Sogou,17 WeChat customer service,20 Guangdian Tong,21 Zhihu,22 facebook,23 whatsApp,24 instagram,25 line,26 discord,33 telegram
    admin_name String Yes Evaluation object, agent or bot
    is_robot String Yes Whether it's a bot, 1: Bot, 0: Agent
    remark String Yes Note information
    tag String No Evaluation Tag
    score_flag String Yes 0 5-star score, 1 10-point score, 2 2-level score
    score String No 5-star score, 5 stars max, positive integer
    nps_score String No 10-point score, 10 points max, integer
    level2_score String No 2-level score, 5 satisfied,1 dissatisfied
    visitorid String No Visitor ID
    date_time String Yes Time, unixtime ms, e.g.: 1539153409792
    cid String Yes Chat ID, the unique identifier of chat
    comment_type String Yes Evaluation type: 0: Invited evaluation, 1: Proactive evaluation
    solved String Yes Tag whether it's resolved, 1: Resolved, 0: Unresolved, -1: Not enabled

    Note: The unique primary key (cid+is_robot)

    Request param:

    Param Type Required Description
    sys_code String Yes Product code, 21
    type String Yes Message type, evaluation
    content List Yes Message Content

    Sample request message:

    {
        "sys_code":"21",
        "type":"evaluation",
        "content":[
            {
                "companyid":"5cc2c708202d4defaf72d4bcac362a55",
                "staffid":"9517",
                "source":"10",
                "admin_name":"",
                "is_robot":"0",
                "remark":"Intended users can follow",
                "tag":"If you don't answer the question, the question cannot be answered",
                "score":"2",
                "visitorid":"97b31cba87e04dcdafe0ebb60248ecf4",
                "date_time":"1468340203266",
                "cid":"9ae05bc279544b68895cd86b12e418e0",
                "comment_type":"1",
                "score_flag":"1",
                "solved":"1"
            }
        ]
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    # ● Online Visitor Information

    content object:

    Param Type Required Description
    companyid String Yes Company ID, applicable to separate statistics on a company with multiple super admin accounts or multiple branches
    userid String Yes Visitor ID
    img String No Visitor avatar
    nick String Yes Visitor nickname
    source String Yes User sources:0 PC,1 WeChat,2 SDK,3 Weibo,4 Mobile site,6 call center,7 ticket center,8 customer center,9 WeCom,10 WeChat mini program,12 baidu,13 toutiao,14 360,15 Alibaba Huichuan,16 Sogou,17 WeChat customer service,20 Guangdian Tong,21 Zhihu,22 facebook,23 whatsApp,24 instagram,25 line,26 discord,33 telegram
    enterprise_name String No Company name. The default value is null string
    user_tels String No Phone no. Two or more phone nos shall be separated by comma ","
    user_emails String No Email. Two or more email addresses shall be separated by comma ","
    qq String No QQ account
    partnerid String No Partner user ID
    user_name String No Visitor name
    province_name String No Province
    city_name String No City name. The default value is null string
    area_name String No County/district name. The default value is null string
    remark String No Note information
    serviceid String Yes Agent ID. Last reception agent
    cid String Yes Chat ID
    params String No Dynamic param, jsonString: passed by customer upon docking
    summary_params String No Service summary related param, jsonString: passed by customer upon docking
    service_no String No Customer Service Staff Number
    address String No Visitor address

    Note: The unique primary key (userid)

    Request param:

    Param Type Required Description
    sys_code String Yes Product code, 21
    type String Yes Message type, user
    content List Yes Message Content

    Sample request message:

    {
        "type":"user",
        "sys_code":"21",
        "content":[
            {
                "companyid":"5cc2c708202d4defaf72d4bcac362a55",
                "userid":"837213545777846",
                "img":"https://img-sg.sobot.io/console/common/face/user.png", 
                "nick":"Merchant king", 
                "source":"10", 
                "enterprise_name":"",
                "user_tels":"13545777846",
                "user_emails":"506003007@qq.com",
                "qq":"784383358",
                "partnerid":"13545777846",
                "user_name":"admin01",
                "province_name":"Shandong", 
                "city_name":"", 
                "area_name":"",
                "remark":"",
                "params":{
                    "KUID":"MTU2NjY0MzE1NTAwMDA3MTAz",
                    "cookie":"88a484e052f1455a8706213cd41c4c94"
                },
                "serviceid":"ea6f8d1a5e8846fd8dfce4ab7057c45c", 
                "cid":"86937e82ae244ad59aeefe41af731079",
                "service_no":"11123",
                "address": "China/ShanDong/QingDao"
            }
        ]
    }
    
    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
    # ● Online Customer Information

    content object:

    Param Type Required Description
    companyid String Yes Company ID, applicable to separate statistics on a company with multiple super admin accounts or multiple branches
    userid String Yes User ID
    img String Yes User avatar
    nick String No User's nickname
    source String Yes User sources:0 PC,1 WeChat,2 SDK,3 Weibo,4 Mobile site,6 call center,7 ticket center,8 customer center,9 WeCom,10 WeChat mini program,12 baidu,13 toutiao,14 360,15 Alibaba Huichuan,16 Sogou,17 WeChat customer service,20 Guangdian Tong,21 Zhihu,22 facebook,23 whatsApp,24 instagram,25 line,26 discord,33 telegram
    enterprise_name String Yes Company name. The default value is null string
    user_tels String No User phone no. The default value is null string
    user_emails String No User email. The default value is null string. This param may be separated by comma ","
    user_name String No User real name. The default value is null string
    qq String No User QQ account. The default value is null string
    country_name String No country
    province_name String Yes Province
    city_name String No City name. The default value is null string
    area_name String No County/district name. The default value is null string
    remark String No Note. The default value is null string
    visitorids String No Visitor ID. The default value is null string
    service_no String No Agent work no. The default value is null string
    serviceid String Yes Agent ID
    cid String Yes Chat ID
    result_list List No Custom Field

    Request param:

    Param Type Required Description
    sys_code String Yes Product code, 21
    type String Yes Message type, userinfo
    content List Yes Message Content

    Sample request message:

    {
        "sys_code":"21",
        "type":"userinfo",
        "content":[
            {
                "companyid":"5cc2c708202d4defaf72d4bcac362a55",
                "userid":"837213545777846",
                "img":"https://img-sg.sobot.io/console/common/face/user.png", 
                "nick":"Merchant king", 
                "source":"10", 
                "enterprise_name":"",
                "user_tels":"13545777846",
                "user_emails":"506003007@qq.com",
                "qq":"784383358",
                "partnerid":"13545777846",
                "user_name":"admin01",
                "country_name": "China",
                "province_name":"Shandong", 
                "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
    30
    31
    # ● Live Chat Message

    content object:

    Param Type Required Description
    companyid String Yes Company ID, applicable to separate statistics on a company with multiple super admin accounts or multiple branches
    cid String Yes Chat ID
    format_time String No Time, format: yyyy-MM-dd HH:mm:ss
    timems String Yes Timestamp, unixtime ms, e.g.: 1539153409792
    senderid String Yes Sender ID, the visitor ID or agent ID or bot ID
    sender_name String No Sender
    receiverid String No Receiver ID, the visitor ID or agent ID or bot ID
    receiver_name String No Receiver
    msg String No Chat content
    docid string No Question ID. Only sender_type=1 messages have knowledge base question ID
    doc_name string No Entry name. Only sender_type=1 messages have knowledge base question entry name
    sender_type String No Sender type: 0: visitor, 1: bot, 2: agent
    receiver_type String No Receiver type: 0: visitor, 1: bot, 2: agent, 3: no receiver (indicating that the message is offline message transferred from submission)
    msg_offline String Yes Whether it's an offline message, 1: YES, 0: NO
    msgid String No Unique key
    revoke_flag String No Non-chat content data, withdrawn message: 1. This field is mutually exclusive with sender_type and receiver_type

    Note: The unique primary key is msgid.

    Request param:

    Param Type Required Description
    sys_code String Yes Product code, 21
    type String Yes Message type, msg
    content List Yes Message Content

    Sample request message:

    chat content:

    {
        "sys_code":"21",
        "type":"msg",
        "content":[
            {
                "companyid":"5cc2c708202sasad2f72d4bcac362a55",
                "cid":"44c603626e2e4c82a5a49619a8aaa397",
                "format_time":"2017-11-01 12:24:04",
                "timems":"1509510244000",
                "senderid":"33c603626e434c82a5a49619aadde451",
                "sender_name":"admin01",
                "receiverid":"5e603626e434c82a5a49619aaqw345",
                "receiver_name":"admin01",
                "msg":"What about a 3-day extension to the repayment date",
                "docid":"88c5342f51134db58ea59f430ad16939",
                "doc_name":"Take a picture",
                "sender_type":"0",
                "receiver_type":"2",
                "msg_offline":"0",
                "msgid":"25e603626e434c82a5a49619aaqw345"
            }
        ]
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23

    withdraw a message:

    {
        "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
    # ● Online Service Summary

    content object:

    Param Type Required Description
    companyid String Yes Company ID, applicable to separate statistics on a company with multiple super admin accounts or multiple branches
    cid String Yes Chat ID
    visitorid String Yes Visitor ID
    operationid String Yes Business unit ID
    operation_name String Yes Business Unit Name
    req_type String Yes Business type ID list, separated by "-"
    req_type_name String Yes Business type name list, separated by "-"
    summary_status String Yes Resolution status: 1: Resolved, 0: Unresolved, -1: Unchecked
    summary_description String Yes Note
    update_time String Yes Update time, e.g.: "1577785628084"
    update_staffId String Yes Operator ID
    invalid_flag String Yes Service summary status: 1: Invalid chat, 0: Valid chat
    update_staff_name String Yes Edit agent name in service summary content
    groupid String Yes Skill group ID
    group_name String Yes Skill Group Name
    fieldid List<String> No Custom field ID list
    field_name List<String> No Custom field name
    field_value List<String> No Custom field value
    start_time String No Chat establishment time
    summary_classify_names String No classification of service
    summary_classify_paths String No service classification path
    summary_classify_codes String No service classification coding
    summary_template_name String No service template
    summary_handle_progress String No Processing progress value
    summary_handle_progress_name String No Processing progress name
    summary_remark String No remark
    customer_fields List<Object> No Custom field

    customer_fields:

    Param Type Required Description
    field_name String No Custom field name
    field_value String No Custom field value
    fieldid String No Custom field ID
    field_text String No Custom field text

    Request param:

    Param Type Required Description
    sys_code String Yes Product code, 21
    type String Yes Message type, summary
    content List Yes Message Content

    Sample request message:

    {
        "sys_code":"21",
        "type":"summary",
        "content":[
            {
                "chat_start_time":"1577779079941",
                "group_name":"test",
                "groupid":"ab900e0cea3f4247981631a7bdb0c694",
                "summary_status":"1",
                "field_name":[
                    "Field 1",
                    "Field 2"
                ],
                "operation_name":"",
                "update_staff_name":"admin03",
                "companyid":"7f72b9c5dee8425fba152a216e528cd4",
                "update_time":"1577779099437",
                "invalid_flag":"0",
                "operationid":"1577330071201",
                "field_value":[
                    "qweqeqw",
                    "eqweqwe"
                ],
                "req_type_name":"mobile-computer",
                "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": "archer",
                "field_value": "archer_custom_value",
                "fieldid": "1733dc105d9c4862b51793fb2f90e76d",
                "field_text": "test-text"
               }]
            }
        ]
    }
    
    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
    # ● Message Forwarding Encryption

    Based on the online message and online call message, Sobot provides encryption function.

    Encryption condition:

    It is necessary to contact the corresponding Sobot support personnel to enable the encryption setting item (provide the message receiving URL first) in the Sobot unified business support management system, and obtain the key provided by Sobot for decryption operation. After the setting item is enabled, the message will be actively pushed after 12:00 that night

    Encryption method:

    AES / CBC / ZeroPadding encryption

    Encryption range:

    After the encryption setting item is enabled, the current encryption range is:
    type: user、userinfo、msg、evaluation、summary、conversation; the encrypted content is the content field. type: ticket;the encrypted content is the content field. type: calllog; the encrypted is the content for each piece of data in the Content array.

    Encryption example:

    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

    Decrypt code instance

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.12.0</version>
        </dependency>
    
    1
    2
    3
    4
    5

    java code

    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 decode method
         *
         * @param data encrypt msg
         * @param key  The key used for encryption
         * @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 the encrypted is the content for each piece of data in the Content array (Java):
    
    ```java
        /**
         * DES decode method
         * @param content encrypt msg
         * @param key The key used for encryption
         * @return String decode msg
         */
        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
    45
    46
    47
    Last Updated: 2/6/2025, 2:22:55 PM

    ← Message Push Knowledge Base V6 API→

    Update Date
    01
    Operations Support API
    04-03
    02
    CRM Docking Scheme
    12-05
    03
    AI Agent API
    09-09
    More Articles>
    Theme by Vdoing
    • Follow Sys
    • Line
    • Dark
    • Read