Developer Documentation Developer Documentation
Help Center (opens new window)
Help Center (opens new window)
  • CRM Product API
  • Agent Management API
    • iFrame Docking
    • Single Sign On (SSO)
    • Mall Center
    • Public Module API
    Sobot
    2022-05-19
    Menus

    Agent Management API

    # Agent Management 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.

    # i18n Declaration

    If the prompt text of the corresponding language needs to be returned when calling the API, the "language" parameter must be contained in the header of the https request.

    Currently, it supports text in both Chinese (zh) and English (en), with Chinese being the default.

    request headers:

    Param Type Required Description
    language String Yes Language identifiers: en-English, zh-Chinese

    # 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 The 3rd-party user's unique API call credential ID
    create_time String Yes Timestamp (s), e.g.: timestamp 1569397773 for 2019-09-25 15:49:33
    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
    # ● Query Agent Role

    API description:

    Acquire role information necessary for adding agents in the system.

    Request method:

    GET

    Request URL:

    https://sg.sobot.io/api/public/5/agent/query_agent_roles
    
    1

    Request example:

    curl -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' https://sg.sobot.io/api/public/5/agent/query_agent_roles
    
    1

    Return param:

    Param Type Required Description
    ret_code String Yes Return code
    ret_msg String Yes Return message
    items List No Object list

    Items set:

    Param Type Required Description
    dict_value String No Role ID
    dict_name String No Role Name
    dict_remark String No Note

    Return example:

    {
        "items": [
            {
                "dict_name": "test1",
                "dict_remark": "test1",
                "dict_value": "1409795602669862969"
            },
            {
                "dict_name": "test2",
                "dict_remark": "556666",
                "dict_value": "1409796429186605113"
            }
        ],
        "ret_code": "000000",
        "ret_msg": "Success"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    # ● Query the Organizational Structure

    API description:

    Acquire information about organizational structure necessary for adding agents in the system

    Request method:

    GET

    Request URL:

    https://sg.sobot.io/api/public/5/agent/query_departments
    
    1

    Request example:

    curl -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' https://sg.sobot.io/api/public/5/agent/query_departments
    
    1

    Return param:

    Param Type Required Description
    ret_code String Yes Return code
    ret_msg String Yes Return message
    items List Yes Object list

    Items set:

    Param Type Required Description
    companyid String Yes Company ID
    departid String Yes Department ID
    depart_name String Yes Department Name
    depart_level String Yes Department level
    depart_type String Yes Department function, 1-online, 2-call, 3-telemarketing, 4-ticket (there may be multiple department functions, and they should be separated by comma, e.g.: 1,2,3)
    parentid String Yes Parent department ID
    sub_department_list List No Sub-department info

    sub_department_list set:

    Param Type Required Description
    companyid String Yes Company ID
    departid String Yes Department ID
    depart_name String Yes Department Name
    depart_level String Yes Department level
    depart_type String Yes Department function, 1-online, 2-call, 3-tTelemarketing, 4-ticket (there may be multiple department functions, and they should be separated by comma, e.g.: 1,2,3)
    parentid String Yes Parent department ID

    Return example:

    {
        "items": [
            {
                "companyid": "5ae2343ada6b5a76fa11b40",
                "departid": "0256cb6f51864761bf63ebf753bdf1e9",
                "depart_level": "0",
                "depart_name": "company",
                "depart_type": "1,2,3,4",
                "parentid": "0",
                "subdepartment_list": [
                    {
                        "companyid": "5ae23431d5604fe3ada6b5a76fa11b40",
                        "departid": "c07d93d438be438ca3ba19e88b2d608f",
                        "depart_level": "1",
                        "depart_name": "Department 2",
                        "depart_type": "4",
                        "parentid": "0256cb6f51864761bf63ebf753bdf1e9"
                    }
                ]
            }
        ],
        "ret_code": "000000",
        "ret_msg": "Success"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    # ● Query Skill Group

    API description:

    Acquire information about skill groups of the company

    Request method:

    GET

    Request URL:

    https://sg.sobot.io/api/public/5/agent/query_groups
    
    1

    Request param:

    Param Type Required Description
    page_no Integer Yes Start page number, not passed or wrong param. 1 by default
    page_size Integer Yes Pieces on each page, not passed or wrong param. 15 by default

    Request example:

    curl -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' https://sg.sobot.io/api/public/5/agent/query_groups?page_no=1&page_size=15
    
    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 Pieces of data

    Items set:

    Param Type Required Description
    groupid String Yes Skill group ID
    group_name String Yes Skill group Name
    group_type String Yes Skill group type, 0: Ticket agent group, 1: Live chat group

    Return example:

    {
        "items": [{
            "groupid": "3bfe772e943c461b9cf6f47440c1a72a",
            "group_name": "A",
            "group_type": "1"
        }],
        "page_count": 1,
        "page_no": 1,
        "page_size": 15,
        "totalcount": 1,
        "ret_code": "000000",
        "ret_msg": "Success"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    # ● Add Skill Group

    API description:

    Add information about skill groups of the company

    Request method:

    POST

    Request URL:

    https://sg.sobot.io/api/public/5/group/save_groups
    
    1

    Request param:

    Param Type Required Description
    group_name String Yes Skill group Name
    group_type String Yes Skill group type, 0: Ticket agent group, 1: live chat group

    Request example:

    curl https://sg.sobot.io/api/public/5/group/save_groups -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' \\
    -d '{"group_name":"group1","group_type":"0"}'
    
    1
    2

    Return param:

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

    Items set:

    Param Type Required Description
    groupid String Yes Skill group ID
    group_name String Yes Skill group Name
    group_type String Yes Skill group type, 0: Ticket agent group, 1: live chat group, 2: Call agent group, 3: Telemarketing group

    Return example:

    {
        "item": [{
             "groupid": "3bfe772e943c461b9cf6f47440c1a72a",
             "group_name": "group1",
             "group_type": "0"
        }],
        "ret_code": "000000",
        "ret_msg": "Success"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    # ● Update Skill Group

    API description:

    Update information about skill groups of the company

    Request method:

    POST

    Request URL:

    https://sg.sobot.io/api/public/5/group/update_groups
    
    1

    Request param:

    Param Type Required Description
    group_name String Yes Skill group name
    groupid String Yes Skill group ID

    Request example:

    curl https://sg.sobot.io/api/public/5/group/update_groups -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' \\
    -d '{"group_name":"group1","groupid":"37cb2e9c740dba4b75a34d535880"}'
    
    1
    2

    Return param:

    Param Type Required Description
    ret_code String Yes Return code
    ret_msg String Yes Return message

    Return example:

    {
        "ret_code": "000000",
        "ret_msg": "Success"
    }
    
    1
    2
    3
    4
    # ● Delete Skill Group

    API description:

    Delete information about skill groups of the company

    Request method:

    POST

    Request URL:

    https://sg.sobot.io/api/public/5/group/delete_groups
    
    1

    Request param:

    Param Type Required Description
    groupid String Yes Skill group ID

    Request example:

    curl https://sg.sobot.io/api/public/5/group/delete_groups -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' \\
    -d '{"groupid":"7cb2e9c740dba4b75a34d53588"}'
    
    1
    2

    Return param:

    Param Type Required Description
    ret_code String Yes Return code
    ret_msg String Yes Return message

    Return example:

    {
        "ret_code": "000000",
        "ret_msg": "Success"
    }
    
    1
    2
    3
    4
    # ● Add Agent to Skill Group

    API description:

    Add agent to skill group

    Request method:

    POST

    Request URL:

    https://sg.sobot.io/api/public/5/group_agent/save_agent
    
    1

    Request param:

    Param Type Required Description
    agent_ids String Yes Agent ID. Multiple IDs are separated by comma
    groupid String Yes Skill group ID

    Request example:

    curl https://sg.sobot.io/api/public/5/group_agent/save_agent -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' \\
    -d '{"agent_ids":"7cb2e9c740dba4b75a34d53588,4ac37cb2e9c740dba4b75a34d5358","groupid":"7cb2e9c740dba4b75a34d53588","group_name":"call group"}'
    
    1
    2

    Return param:

    Param Type Required Description
    ret_code String Yes Return code
    ret_msg String Yes Return message

    Return example:

    {
        "ret_code": "000000",
        "ret_msg": "Success"
    }
    
    1
    2
    3
    4
    # ● Delete Agents in Skill Group

    API description:

    Delete agents in skill group

    Request method:

    POST

    Request URL:

    https://sg.sobot.io/api/public/5/group_agent/delete_agent
    
    1

    Request param:

    Param Type Required Description
    groupid String Yes Skill group ID
    agentid String Yes Agent ID

    Request example:

    curl https://sg.sobot.io/api/public/5/group_agent/delete_agent -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' \\
    -d '{
    "agentid":"7cb2e9c740dba4b75a34d53588","groupid":"7cb2e9c740dba4b75a34d53588"}'
    
    1
    2
    3

    Return param:

    Param Type Required Description
    ret_code String Yes Return code
    ret_msg String Yes Return message

    Return example:

    {
        "ret_code": "000000",
        "ret_msg": "Success"
    }
    
    1
    2
    3
    4
    # ● Query Agents in Skill Group

    API description:

    Query agents in skill group

    Request method:

    GET

    Request URL:

    https://sg.sobot.io/api/public/5/group_agent/query_agents
    
    1

    Request param:

    Param Type Required Description
    groupid String Yes Skill group ID

    Request example:

    curl -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' https://sg.sobot.io/api/public/5/group_agent/query_agents?groupid=7cb2e9c740dba4b75a34d53588
    
    1

    Return param:

    Param Type Required Description
    ret_code String Yes Return code
    ret_msg String Yes Return message
    items List Yes Object list

    Items set:

    Param Type Required Description
    companyid String Yes Enterprise ID
    create_agentid String Yes Creator ID
    create_time Long Yes Creation Time
    agent_role_type String Yes Role type. Refer to the Role Type Dictionary Table
    agent_role_name String Yes Role name. Refer to the Role Type Dictionary Table
    effect_time Long No Valid Time
    login_status String No Login status, 0: Not logged in, 1: Logged in
    phone_no String No Phone no.
    agent_email String Yes Agent email
    agentid String Yes Agent ID
    agent_name String Yes Agent name
    agent_nick String Yes Agent Nickname
    agent_status String Yes Agent status, 0: Not activated, 1: Enabled, 2: Platform controlled, 9: Disable, -1: Delete
    update_time String Yes Update Time

    Return example:

    {
        "items": [
            { 
            "companyid": "5ae23431d5604f6b5a76fa11b40",
            "create_agentid": "5571169a9dd94b9a163b7160401",
            "create_time": 1567499327,
            "agent_role_type": "1",
            "agent_role_name": "Super Admin",
            "effect_time": 1567499327,
            "login_status": 1,
            "phone_no": "176114332019",
            "agent_email": "zhags@sobot.io",
            "agentid": "5571169a9dd94bsfsdsa163b7160401",
            "agent_name": "admin5",
            "agent_nick": "admin5",
            "agent_status": 1,
            "update_time": 1567499327
            }
        ],
        "retCode": "000000",
        "retMsg": "Success"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    # ● Query the company's time zone ID settings

    API description:

    Query the company's time zone ID settings

    Request method:

    GET

    Request URL:

    https://sg.sobot.io/api/public/5/agent/query_company_timezone
    
    1

    Request example:

    curl -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' https://sg.sobot.io/api/public/5/agent/query_company_timezone
    
    1

    Return param:

    Param Type Required Description
    ret_code String Yes Return code
    ret_msg String Yes Return message
    items List Yes Object list

    Return example:

    {
        "items": [
            "Etc/GMT+12",
            "US/Hawaii",
            "America/New_York",
            "Asia/Kolkata",
            "Asia/Shanghai"
        ],
        "ret_code": "000000",
        "ret_msg": "Success"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    # ● Query Agent List

    API description:

    Query information about all agents of the company

    Request method:

    GET

    Request URL:

    https://sg.sobot.io/api/public/5/agent/query_agents
    
    1

    Request param:

    Param Type Required Description
    page_no Integer Yes Start page, not passed or wrong param. 1 by default
    page_size Integer Yes Pieces on each page, not passed or wrong param. 15 by default

    Request example:

    curl -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' https://sg.sobot.io/api/public/5/agent/query_agents?page_no=1&page_size=15
    
    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 Pieces of data

    Items set:

    Param Type Required Description
    agentid String Yes Agent ID
    companyid String Yes Company ID
    agent_name String Yes Agent's real name
    agent_nick String Yes Agent Nickname
    agent_status String Yes Agent status, 1: Enabled 9: Disable, -1: Delete
    agent_email String Yes Agent email
    phone_no String No Agent's phone no.
    max_accept Integer No Agent's max reception limit
    agent_role_type String Yes Agents role type, 1: super admin, 2: admin, 3: general agent
    agent_roleid String Yes Agent role ID
    agent_role_name String Yes Agent role name
    departid String No Agent's department ID
    depart_name String No The agent belongs to multiple departments, and the department names are separated by comma
    main_departid String No Main depart ID
    main_depart_name String No Main depart name
    language String No Language identifiers: en-English, zh-Chinese
    workbench_lang String No Agent workbench language: en-English, zh-Chinese,pt-Portuguese,fr-French,es-spanish
    agent_partner_id String No Docking ID
    duty String No Duty

    Return example:

    {
        "items": [
            {
                "companyid": "5ae23431d5604fe3ada6b5a76fa11b40",
                "agent_role_type": "1",
                "agent_roleid": "147239050240283",
                "agent_role_name": "Super Admin",
                "departid": "6cb6f51864761bf63ebf753bdf1e9",
                "depart_name": "company",
                "phone_no": "17611470819",
                "max_accept": 10,
                "agent_email": "zhang@sobot.io",
                "agentid": "557116dd94b9585e0a163b7160401",
                "agent_name": "admin5",
                "agent_nick": "admin5",
                "agent_status": "1",
                "language": "en"
            }
        ],
        "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
    # ● Add Agent Information

    API description:

    Add agent information

    Request method:

    POST

    Request URL:

    https://sg.sobot.io/api/public/5/agent/save_agent
    
    1

    Request param:

    Param Type Required Description
    agent_nick String Yes Agent Nickname
    agent_name String Yes Agent's real name
    phone_no String No Phone no.
    password String No Password
    email String Yes Agent email
    agent_roleid String Yes Agent role ID
    departid String Yes Department ID, multiple department IDs are separated by “,”
    max_accept String Yes Max reception limit, with a positive integer between 0-100
    main_departid String No Main depart ID,When the parameter is blank, the first value of departid will be used as the main department
    language String No Language identifiers: en-English, zh-Chinese
    timezoneid String No Agent time zone, obtained from the company's set time zone.
    workbench_lang String No Agent workbench language: en-English, zh-Chinese,pt-Portuguese,fr-French,es-spanish
    agent_partner_id String No Docking ID

    Request example:

    curl https://sg.sobot.io/api/public/5/agent/save_agent -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' \\
    -d '{"agent_nick":"customer09104","agent_name":"zhang","agent_roleid":"147239050240283","email":"zhang@sobot.io","departid":"0256cb6f513bdf1e9","max_accept":10}'
    
    1
    2

    Return param:

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

    Item object:

    Param Type Required Description
    companyid String Yes Company ID
    agent_nick String Yes Agent Nickname
    agent_name String Yes Agent's real name
    agentid String Yes Agent ID

    Return example:

    {
        "item": {
            "companyid":"6573198191ad4b17a0173c9bb1b012fe",
            "agent_nick":"admin5",
            "agent_name":"admin5",
            "agentid":"557116dd94b9585e0a163b7160401"
        },
        "ret_code": "00000",
        "ret_msg": "Success"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    # ● Update Agent Information

    API description:

    Update agent information

    Request method:

    POST

    Request URL:

    https://sg.sobot.io/api/public/5/agent/update_agent
    
    1

    Request param:

    Param Type Required Description
    agentid String Yes Agent ID
    agent_nick String Yes Agent Nickname
    agent_name String Yes Agent's real name
    agent_roleid String Yes Agent role ID
    departid String Yes Department ID, multiple department IDs are separated by “,”
    max_accept String Yes Max reception limit, with a positive integer between 0-100
    phone_no String No Agent's phone no.
    agent_status String No Agent status, 1 Enabled, 9: Disable, -1: Delete (The enabled status can be changed to disable, and vice versa. Other status cannot be changed.)
    main_departid String No Main depart ID,When the parameter is blank, the first value of departid will be used as the main department
    language String No Language identifiers: en-English, zh-Chinese
    timezoneid String No Agent time zone, obtained from the company's set time zone.
    workbench_lang String No Agent workbench language: en-English, zh-Chinese,pt-Portuguese,fr-French,es-spanish
    agent_partner_id String No Docking ID

    Request example:

    curl https://sg.sobot.io/api/public/5/agent/update_agent -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' \\
    -d '{"agent_nick":"nick4","agent_name":"name",""phone_no":"17847586079","agent_roleid":"147239050240283","email":"zhang@sobot.io","departid":"0256cb6f513bdf1e9","max_accept":10}'
    
    1
    2

    Return param:

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

    Item object:

    Param Type Required Description
    companyid String Yes Company ID
    agent_nick String Yes Agent Nickname
    agent_name String Yes Agent's real name

    Return example:

    {
        "item": {
            "companyid":"6573198191ad4b17a0173c9bb1b012fe",
            "agent_nick":"admin5",
            "agent_name":"admin5"
        },
        "ret_code": "000000",
        "ret_msg": "Success"
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    # ● Delete Agent Information

    API description:

    Delete agent information

    Request method:

    POST

    Request URL:

    https://sg.sobot.io/api/public/5/agent/delete_agent
    
    1

    Request param:

    Param Type Required Description
    agentid String Yes Agent ID

    Request example:

    curl -X POST -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en'
    https://sg.sobot.io/api/public/5/agent/delete_agent 
    -d '{"agentid":"e836ef1e8984fc5bc8af3"}'
    
    1
    2
    3

    Return param:

    Param Type Required Description
    ret_code String Yes Return code
    ret_msg String Yes Return message

    Return example:

    {
        "ret_code": "000000",
        "ret_msg": "Success"
    }
    
    1
    2
    3
    4
    # ● Create Agents in Bulk

    API description:

    Create agents in bulk

    Request method:

    POST

    Request URL:

    https://sg.sobot.io/api/public/5/agent/batch_save_agent
    
    1

    Request param:

    Param Type Required Description
    agent_nick String Yes Agent Nickname
    agent_name String Yes Agent's real name
    phone_no String No Phone no.
    password String No Password
    email String Yes Agent email
    agent_roleid String Yes Agent role ID
    departid String Yes Department ID, multiple department IDs are separated by “,”
    max_accept String Yes Max reception limit, with a positive integer between 0-100
    main_departid String No Main depart ID,When the parameter is blank, the first value of departid will be used as the main department
    language String No Language identifiers: en-English, zh-Chinese
    timezoneid String No Agent time zone, obtained from the company's set time zone.
    workbench_lang String No Agent workbench language: en-English, zh-Chinese,pt-Portuguese,fr-French,es-spanish
    agent_partner_id String No Docking ID

    Request example:

    curl https://sg.sobot.io/api/public/5/agent/batch_save_agent -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' \\
    -d '[
    {"email":"jkljlj@sobot.io","agent_name":"test1","agent_nick":"nick1","agent_roleid":"147239050240283","max_accept":"23","departid":"123","password":"1234"},
    {"email":"1234er@sobot.io","agent_name":"test1","agent_nick":"nick1","agent_roleid":"147239050240283","max_accept":"23","departid":"123","password":"1234"}
    ]'
    
    1
    2
    3
    4
    5

    Return param:

    Param Type Required Description
    ret_code String Yes Return code
    ret_msg String Yes Return message

    Return example:

    {
        "ret_code": "000000",
        "ret_msg": "Success"
    }
    
    1
    2
    3
    4
    # ● Query Agent Information

    API description:

    Query information about all agents of the company

    Request method:

    GET

    Request URL:

    https://sg.sobot.io/api/public/5/agent/list
    
    1

    Request param:

    Param Type Required Description
    agentid String No Agent ID
    agent_name String No Agent Name
    email String No Agent email
    departid String No Department ID
    page_no Integer No Start page, not passed or wrong param. 1 by default
    page_size Integer No Pieces on each page, not passed or wrong param. 15 by default

    Request example:

    curl -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' https://sg.sobot.io/api/public/5/agent/agent/list?agentid=f70ade8aac31457bb182417b0cfe447c&page_no=1&page_size=15
    
    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 Pieces of data

    Items set:

    Param Type Required Description
    agentid String Yes Agent ID
    companyid String Yes Company ID
    agent_name String Yes Agent's real name
    agent_nick String Yes Agent Nickname
    agent_status String Yes Agent status, 1: Enabled 9: Disable, -1: Delete
    agent_email String Yes Agent email
    agent_no String Yes Agent no.
    phone_no String No Agent's phone no.
    max_accept Integer No Agent's max reception limit
    agent_role_type String Yes Agents role type, 1: super admin, 2: admin, 3: general agent
    agent_roleid String Yes Agent role ID
    agent_role_name String Yes Agent role name
    departid String No Agent's department ID
    depart_name String No The agent belongs to multiple departments, and the department names are separated by comma
    timezoneid String No Agent's Timezone
    language String No Agent's language
    workbench_lang String No Agent workbench language: en-English, zh-Chinese,pt-Portuguese,fr-French,es-spanish
    agent_partner_id String No Docking ID
    duty String No Duty

    Return example:

    {
        "items": [
           {
            "agent_email": "ed78cb778e6adc5cc7bbb6e03e41a0ec@corp26022.sobot.io",
            "agent_name": "real",
            "agent_nick": "nic",
            "agent_no": "007",
            "agent_role_name": "Super Admin",
            "agent_role_type": "2",
            "agent_roleid": "1422878660180328449",
            "agent_status": "1",
            "agentid": "f70ade8aac31457bb182417b0cfe447c",
            "companyid": "60b7e31daf15417aa0f521aa7d822ddd",
            "depart_name": "demartName",
            "departid": "78f26da140dbba9b637144bd858fcd26,91bbff23c25dbb2aa98f9c4df1f7c0f9",
            "max_accept": 8,
            "phone_no": "15650752293"
           }
        ],
        "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 Blank token
    900002 Token expired. Get a new one
    900003 Signature error
    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 ID not found
    700007 Agent email cannot be blank
    700008 Wrong Agent Address Format
    700009 Agent email already exists
    700010 Email not registered
    700011 Agent nickname is too long
    700012 Agent name is too long
    700013 Agent nickname cannot contain tags and symbols
    700014 Incorrect reception limit digital format! Enter an integer of 0~100
    700015 Agent department does not match the role. Select again
    700016 Request param error
    700017 The current agent cannot be changed
    700018 Agent role does not match the selected department function. Select agent role or affiliated department again
    700019 Wrong phone no. format
    700020 Blank phone no.
    700021 The number reached the limit! If you want to add more, contact Sobot after-sales personnel for purchase
    700022 Unable to complete the conversion of admin and general agent roles in the department. Remove the agent on [Organizational Structure] page and then change the role
    700024 Skill group name is too long
    700025 Skill group name repeated, enter again
    700026 Skill group name cannot be blank
    700027 Skill group ID cannot be blank
    700028 Agent is in login status and cannot be removed from skill group. Try again after it goes offline
    700029 Delete corresponding trigger or SLA first
    700030 Skill group is still in intelligent routing, unable to delete. Remove the skill group assigned in intelligent routing, try to delete again
    700031 Record not found
    700032 Operation failed. The skill group members have logged in. Operate after they log out
    700033 This agent does not enable call center, unable to add
    700034 No. of inbound agent groups and telemarketing groups is 100 max
    700035 Failed to add. Agent id[id value] doesn't exist and exceeds the available range
    700036 Failed to add. Agent id[id value] already exists in the telemarketing skill group
    700037 Skill group id not found
    700038 The agent role is super admin and cannot be changed
    700039 The agent role is super admin and cannot be deleted
    700040 It is not allowed to change the role to super admin. Log in the system before operation
    700041 Agent email is too long
    700042 Incorrect agent status
    700043 Incorrect agent role
    700044 Agent department ID cannot be blank
    700045 Incorrect agent department ID
    700046 Agent No. is too long
    700047 Agent language error
    Last Updated: 2/8/2025, 2:07:39 PM

    ← CRM Product API iFrame Docking→

    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