Developer Documentation Developer Documentation
Help Center (opens new window)
Help Center (opens new window)
  • Ticket Center

    • Ticket API
    • Android SDK
    • iOS SDK
  • Inspection API
    • Management Assistance Product API
    Sobot
    2022-05-19
    Menus

    Inspection API

    # Inspection API

    # API Declaration

    The "token" param must be contained in the header of the https request when calling the API.

    Token is the only global API call credential for the Sobot API open platform. It is used when developers call the business APIs and thus should be properly kept. At least 32 chars should be reserved to store token. The validity period of token is currently 24 hours. It needs to be refreshed regularly or reacquired according to the token failure prompt returned by the API. When requesting the token API, regardless of the existence of token, a new token will be returned and its expiry time will be reset (currently 24 hours).

    Token usage description:

    1. Developers need to obtain and manage the token uniformly. When calling the Sobot open APIs of various business, they should use the same token, instead of refreshing and obtaining new tokens for each business. Otherwise, it will easily lead to token invalidation and affect the normal API call.
    2. The current validity period of the token is transmitted by the returned expire_in, which is currently a value within 86,400 s. Developers need to refresh the new token in advance based on this valid time.
    3. Developers should reacquire the token according to the token invalidation prompt returned by the API.

    # API Call

    # ● Get the Access Token Code

    API description:

    Get the open API token, which is only applicable to all APIs of Sobot Open Platform v5.0. Contact the Sobot after-sales service personnel to get appid and app_key in the API.

    Request method:

    GET

    Request URL:

     https://sg.sobot.io/api/get_token
    
    1

    Request param:

    Param Type Required Description
    appid String Yes API credential id, the unique API call credential id for the 3rd-party users
    create_time String Yes Timestamp , Timestamp (s), e.g.: timestamp 1569397773 for 2019-09-25 1533
    sign String Yes Signature, which is md5(appid+create_time+app_key) sign signature; app_key is a key

    Request example:

    curl https://sg.sobot.io/api/get_token?appid=1&create_time=1569397773&sign=258eec3118705112b2c53dc8043d4d34
    
    1

    Return param:

    Param Type Required Description
    ret_code String Yes Return code
    ret_msg String Yes Return message
    item Object No Return object

    Item object:

    Param Type Required Description
    token String Yes Token code
    expires_in String Yes Credential valid time (unit: s)

    Timestamp conversion tool:

    https://www.unixtimestamp.com/

    sign Signature generation example:

    E.g., appid = "1"; create_time="1569397773"; app_key="2"

    sign = Md5("115693977732") is 258eec3118705112b2c53dc8043d4d34.

    Return example:

    {
       "item": {
           "token": "4ac37cb2e9c740dba4b75a34d5358802",
           "expires_in": "86400"
       },
       "ret_code": "000000",
       "ret_msg": "Success"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    # ● Acquire Call Inspection Results

    API description:

    Acquire the call inspection results in the system(Only supports the new version)

    Request method:

    GET

    Request URL:

     https://sg.sobot.io/api/newQuality/5/quality/call_result
    
    1

    Request param:

    Param Type Required Description
    start_datetime Long Yes Start Time , e.g.: 1724913355445
    end_datetime Long Yes End time, e.g.: 1724913355445
    page_no Integer No Current page (start from the first page by default)
    page_size Integer No Pieces on each page (15 by default; 100 max)

    Request example:

    curl -H 'token: 4ac37cb2e9c740dba4b75a34d5358802 ' https://sg.sobot.io/api/newQuality/5/quality/call_result?start_datetime=1724913355445&end_datetime=1724913355445&page_no=1&page_size=100
    
    1

    Return param:

    Param Type Required Description
    ret_code String Yes Return code
    ret_msg String Yes Return message
    items List Yes Object list
    page_count Integer Yes Total pages
    page_no Integer Yes Start page
    page_size Integer Yes Pieces on each page
    total_count Integer Yes Total pieces of data

    Items set:

    Param Type Required Description
    agentid String Yes Agent ID
    agent_name String Yes Agent name
    agent_email String Yes Agent email
    call_start_datetime String Yes Talk start time
    call_log_jestid String Yes Talk ID
    schemeid String Yes Quality inspection plan ID
    quality_datetime String Yes Inspection time
    total_score_max String Yes Full score for inspection
    standard_score_max String Yes Full score for inspection standard score item
    pulse_max String Yes Full score for inspection additional score item
    minus_max String Yes Full score for inspection score deduction item
    total_score String Yes Inspection score
    standard_score String Yes Inspection standard score item score
    pulse String Yes Inspection additional score item score
    minus String Yes Inspection deduction item score

    Return example:

    {
        "items": [
            {
                "standard_score_max": "15",
                "pulse_max": "0",
                "minus": "0",
                "agent_email": "132@sobot.io",
                "quality_datetime": "1554971786077",
                "call_start_datetime": "1553594283000",
                "agent_name": "testxx",
                "total_score": "132",
                "call_log_jestid": "b212d432-ea8f-4701-9637-d01c8a5d9945",
                "schemeid": "2856580f156a4f9ea73dd4e9ac86896e",
                "total_score_max": "0",
                "pulse": "10",
                "agentid": "2856580f156a4f9ea73dd4e9ac86896e",
                "standard_score": "0",
                "minus_max": "0"
            }],
        "page_count": 1,
        "page_no": 1,
        "page_size": 15,
        "ret_code": "000000",
        "ret_msg": "Success",
        "total_count": 1
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    # ● Get Online Inspection Results

    API description:

    Acquire online inspection results

    Request method:

    GET

    Request URL:

     https://sg.sobot.io/api/newQuality/5/quality/chat_result
    
    1

    Request param:

    Param Type Required Description
    start_datetime Long Yes Start Time , e.g.: 1724913355445
    end_datetime Long Yes End time, e.g.: 1724913355445
    page_no Integer No Current page (start from the first page by default)
    page_size Integer No Pieces on each page (15 by default; 100 max)

    Request example:

    curl -H 'token: 4ac37cb2e9c740dba4b75a34d5358802 ' https://sg.sobot.io/api/newQuality/5/quality/chat_result?start_datetime=1724913355445&end_datetime=1724913355445&page_no=1&page_size=100
    
    1

    Return param:

    Param Type Required Description
    ret_code String Yes Return code
    ret_msg String Yes Return message
    items List Yes Object list
    page_count Integer Yes Total pages
    page_no Integer Yes Start page
    page_size Integer Yes Pieces on each page
    total_count Integer Yes Total pieces of data

    Items set:

    Param Type Required Description
    agentid String Yes Agent ID
    agent_name String Yes Agent name
    agent_email String Yes Agent email
    chat_start_datetime String Yes Chat start time (ms)
    cid String Yes Chat ID
    schemeid String Yes Quality inspection plan ID
    quality_datetime String Yes Inspection time
    total_score_max String Yes Full score for inspection
    standard_score_max String Yes Full score for inspection standard score item
    pulse_max String Yes Full score for inspection additional score item
    minus_max String Yes Full score for inspection score deduction item
    total_score String Yes Inspection score
    standard_score String Yes Inspection standard score item score
    pulse String Yes Inspection additional score item score
    minus String Yes Inspection deduction item score

    Return example:

    {
          "items": [
                {
                  "standard_score_max": "15",
                  "pulse_max": "0",
                  "minus": "0",
                  "agent_email": "132@sobot.io",
                  "quality_datetime": "1554971786077",
                  "chat_start_datetime": "1553594283000",
                  "agent_name": "testxx",
                  "total_score": "132",
                  "cid": "2856580f156a4f9ea73dd4e9ac86896e",
                  "schemeid": "2856580f156a4f9ea73dd4e9ac86896e",
                  "total_score_max": "0",
                  "pulse": "10",
                  "agentid": "2856580f156a4f9ea73dd4e9ac86896e",
                  "standard_score": "0",
                  "minus_max": "0"
                }],
          "page_count": 1,
          "page_no": 1,
          "page_size": 15,
          "ret_code": "000000",
          "ret_msg": "Success",
          "total_count": 1
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26

    # API return code

    # ● Operation Done
    Return code Code description
    000000 Operation done (Any code other than this code is an error code)
    # ● System Exception
    Return code Code description
    700046 The current version purchased by the enterprise does not support the use of API(not available in free and overseas team versions)
    900001 Null token
    900002 Token expired. Get a new one
    900003 Incorrect signature
    900004 Company api configuration info not found
    999999 Unknown System Exception
    # ● Business Exception
    Return code Code description
    700001 Company id cannot be blank
    700002 Agent id cannot be blank
    700003 Agent nickname cannot be blank
    700004 Agent real name cannot be blank
    700005 Agent role id cannot be blank
    700006 Agent role cannot be blank
    700007 Agent email cannot be blank
    700008 Wrong agent email format
    700009 Agent email already exists
    Last Updated: 4/2/2025, 11:12:43 AM

    ← iOS SDK

    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