logo

Get agent group list

This interface is used to retrieve information about multiple customer service groups in one request.

Request Method

GET /user_groups

Request Parameters (Query String)

Parameter NameRequiredTypeDescriptionLimitations
pageNoIntegerPage number, starting from 1, default is 1
per_pageNoIntegerNumber of items per page, default is 20, maximum is 100

Return Data

Attribute NameTypeDescription
codeIntegerExecution result code, 1000 represents success
metaObjectPagination information, see Common Data
user_groupsArrayList of customer service groups, see details below

Customer Service Group Data

Attribute NameTypeDescription
idIntegerUnique identifier
nameStringName
agentsArrayIncludes customer service agents
agents element structure
ValueDescription
idCustomer service unique identifier
nick_nameCustomer service name

Example

curl https://demo.udesk.cn/open_api_v1/user_groups?page=1&per_page=10&email=admin@udesk.cn&timestamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2

Response

{
    "code": 1000,
    "user_groups": [
        {
            "id": 1,
            "name": "Agent Group 1",
            "agents": [
                {"id": 1, "nick_name": "Test Agent1"}
            ]
        }
    ],
    "meta": {
        "current_page": 1,
        "total_pages": 1,
        "total_count": 1
    }
}

Get agents under agent group

This interface is used to retrieve information about customer service agents under multiple customer service groups in one request.

Request Method

GET /user_groups/:id/agents

Request Parameters (Query String)

Parameter NameRequiredTypeDescriptionLimitations
pageNoIntegerPage number, starting from 1, default is 1
per_pageNoIntegerNumber of items per page, default is 20, maximum is 100

Return Data

Attribute NameTypeDescription
codeIntegerExecution result code, 1000 represents success
user_groupObjectCustomer service group details

Customer Service Group Data

Attribute NameTypeDescription
idIntegerUnique identifier
nameStringName
agentsArrayIncludes customer service agents
agents element structure
ValueDescription
idCustomer service unique identifier
nick_nameCustomer service name
emailCustomer service email
cellphoneCustomer service phone number
work_idJob number
im_ability_valueDialogue skill value
profileEmployee type
aliaseExternal nickname
role_nameAccount type
dutyPosition
user_group_idsList of group IDs to which the agent belongs
disable_statusStatus (enable: enabled, disable: disabled)
avatarAvatar
langLanguage preference
availabilityWhether to accept automatic work order assignment
im_welcomesWelcome language
user_groupsEmployee groups to which the agent belongs
agent_rolesRoles of the employees
departmentsDepartments to which the employee belongs
agent_callout_display_numberExternal calling display number
numberSIP information
passwordSIP information

Example

curl http://demo.udesk.cn/open_api_v1/user_groups/1/agents?page=1&per_page=10&email=admin@udesk.cn&timestamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2

Response

{
    "code": 1000,
    "user_groups": [
        {
            "id": 1,
            "name": "Agent Group 1",
            "agents": [
                {
                    "id": 1,
                    "nick_name": "Test Agent1",
                    "cellphone": 12345678901,
                    "work_id": 1,
                    "profile": "all",
                    "aliase": "Test Agent1",
                    "role_name": "agent",
                    "duty": null,
                    "user_group_ids": [1],
                    "im_ability_value": 10,
                    "disable_status": "enable",
                    "avatar": "http://attachments.gfan.com/forum/attachments2/201302/03/11281446n2st1its4152n5.jpg",
                    "lang": "en-us",
                    "availability": true,
                    "im_welcomes": "",
                    "user_groups": [
                        {"id":2,"name":"Agent Group 1"}
                    ],
                    "agent_roles": [
                        {"id": 1, "name": "role 1", "description": ""}
                    ],
                    "departments": [
                        {"id":1,"name":"Department 1"},
                        {"id":3,"name":"Department 3"}
                    ],
                    "agent_callout_display_number": "",
                    "number": "",
                    "password": ""
                }
            ]
        }
    ]
}

create agent group

This interface is used to create a customer service group.

Request Method

POST /user_groups

Request Parameters (request body)

ParameterRequiredTypeDescriptionLimitationsDefault
nameYesStringCustomer service group nameNo more than 255 charactersNone

Return Data

Attribute NameTypeDescription
codeIntegerExecution result code, 1000 represents success
idIntegerCreated customer service group ID

Example

Request

curl https://demo.udesk.cn/open_api_v1/user_groups?email=admin@udesk.cn&timestamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2 \
-X POST \
-H 'content-type:application/json' \
-d '{
"name":"Agent Group 1"
}'

Response

{
    "id": 1,
    "code": 1000
}

Update Agent Group

This interface is used to modify a customer service group.

Request Method

PUT /user_groups/:id

Request Parameters (request body)

ParameterRequiredTypeDescriptionLimitationsDefault
nameYesStringCustomer service group nameNo more than 255 charactersNone

Return Data

Attribute NameTypeDescription
idIntegerID of the customer service group modified by this operation
codeIntegerExecution result code, 1000 represents success
user_groupObjectCustomer service group information, structure as follows

user_group structure

Attribute NameTypeDescription
idIntegerUnique identifier
nameStringName
agentsArrayIncludes customer service agents

Example

Request

curl https://demo.udesk.cn/open_api_v1/user_groups/1?email=admin@udesk.cn&timestamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2 \
-X PUT \
-H 'content-type:application/json' \
-d '{
"name":"Agent Group 2"
}'

Response

{
    "code": 1000,
    "user_group": {
      "id": 1,
      "name": "Agent Group 2",
      "agents": [
                {"id": 1, "nick_name": "Test Agent1"},
                {"id": 2, "nick_name": "Test Agent2"}
            ]
    }
}

Delete Agent Group

This interface is used to delete a customer service group.

Request Method

DELETE /user_groups/:id

Request Parameters (url)

Parameter NameTypeRequiredDescriptionLimitations
idIntegerYesCustomer service group ID

Request Parameters (request body)

None

Return Data

Attribute NameTypeDescription
codeIntegerExecution result code, 1000 represents success
messageStringExecution result description

Example

Request

curl https://demo.udesk.cn/open_api_v1/user_groups/1?email=admin@udesk.cn&timestamp=1494474404&sign=6892f1b794071c260e1b1eac15df588fc919c9e86eb742affaa742ad6c03cb52&nonce=2d931510-d99f-494a-8c67-87feb05e1594&sign_version=v2
 \
-X DELETE \
-H 'content-type: application/json' \

Response

{
    "message": "The customer service group with ID 1 was successfully deleted",
    "code": 1000
}

Code Error Code Description

Error CodeDescription of message informationDescription of exception: message informationDescription
2000Unknown errorValidation failed: Group name cannot be an empty stringRequired parameter name cannot be empty
name cannot be emptyNoneParameter name must not be empty
2005Resource not foundCouldn't find UserGroup with id=xxx [WHERE user_groups.company_id = ? AND user_groups.category = 'General customer service group']Parameter id does not match any value