Updated on 2023-12-19 GMT+08:00

Querying Agent Rest Information in a Specified VDN

Scenario

This interface is invoked to query all agent rest information in a specified VDN.

Interface Method

The request method must be set to POST. This interface supports only the POST method.

Internal Encapsulation Interface

BMS interfaces:

  • /ccbms/ws/monitor/teamrestinfo
  • /ccbms/ws/monitor/teamrestagentinfo
  • /ccbms/ws/monitor/agentstatusinfobyagentids

Request URL

https://ip:port/rest/cmsapp/v1/openapi/vdn/queryagentreststate

In a public cloud environment, ip indicates the IP address of the CC-CMS server, and port indicates the HTTPS port number of the CC-CMS server. Contact the administrator to obtain the values.

In a non–public cloud environment where the NSLB service is configured, ip indicates the IP address of the NSLB server, and port indicates the HTTPS port number of the CC-CMS service mapped on the NSLB server.

Request Description

Table 1 Parameters in the request header

No.

Parameter

Value Type

Mandatory

Description

1

Content-Type

String

Yes

The value is fixed at application/json; charset=UTF-8.

2

Authorization

String

Yes

For details about the generation mode, see C2 Monitoring, System Outbound Call, CDR, and Knowledge Base Interface Authentication.

Table 2 Parameters in the request message body

No.

Parameter

Value Type

Mandatory

Description

1

ccId

Integer

Yes

ID of a call center.

The value ranges from 1 to 65535.

2

vdn

Integer

Yes

ID of a VDN.

The value ranges from 1 to 5000.

3

limit

Integer

Yes

Number of query records on each page.

The value ranges from 1 to 1000.

4

offset

Integer

Yes

Parameter for determining the start page of the query. Value of offset = Value of limit x (Value of page – 1). The value of offset is greater than or equal to 0.

page indicates the start page of the query.

Response Description

Table 3 Parameters in the response message body

No.

Parameter

Value Type

Description

1

result

String

Query result. The options are as follows:

  • 0: success
  • Other values: failure

For details about the failure causes, see Error Code Reference.

NOTE:

This field is reserved for compatibility with interface response parameters in 8.13 and earlier versions.

2

resultCode

String

Query result. The options are as follows:

  • 0100000: success
  • Other values: failure
  • For details about the failure causes, see Error Code Reference.

3

resultDatas

Object

Object in the returned result after a successful query.

For details about the parameters of this object, see Table 4.

NOTE:

This field is reserved for compatibility with interface response parameters in 8.13 and earlier versions.

4

resultDesc

Object

Object in the returned result after a successful query.

For details about the parameters of this object, see Table 4.

5

count

Integer

Total number of agents in the VDN.

Table 4 Parameters of resultDesc/resultDatas

No.

Parameter

Value Type

Description

2.1

onRestAgentNum

Integer

Number of resting agents.

2.2

allowRestAgentNum

Integer

Number of agents who are allowed to have a rest but still at work.

2.3

waitRestAgentNum

Integer

Number of agents who apply for a rest.

2.4

details

Array

Agent rest details. For details about the parameters of the object in this array, see Table 5.

NOTE:

The response result is the agent rest data obtained based on the pagination parameters limit and offset in the request.

For example, if both limit and offset are set to 10, the 10 agents on the second page (10 agents per page) are obtained, and then rest statistics on the 10 agents are collected.

Table 5 Agent rest details

No.

Parameter

Value Type

Description

2.4.1

agentId

Integer

Agent ID.

2.4.2

cantRestCause

Integer

Reason why agents are not allowed to have a rest. This parameter is valid only for the agents who wait for a rest.

For details about the parameters of this object, see Table 6.

2.4.3

vdnId

Integer

ID of a VDN.

2.4.4

ccId

Integer

ID of a call center.

2.4.5

beginTime

Long

Start time. This parameter indicates the rest start time for resting agents, and the start time of applying for or approving a rest for agents not resting. The time format is timestamp.

2.4.6

applyRestLength

Integer

Requested rest duration, in seconds.

2.4.7

name

String

Agent name.

2.4.8

reqRestDura

Long

Rest duration, that is, the rest duration of an agent who is taking a rest, in seconds.

2.4.9

skillIds

String

Skill queue to which an agent waiting for a rest signs in. The value is returned only when the value of cantRestCause is 4.

Table 6 Reason for not allowing rest

Value of the Reason for Not Allowing Rest

Description

0

The agent is waiting for approval.

1

The agent is in busy state.

2

The number of agents who can take a rest in the VDN reaches the maximum.

3

The agent does not answer any inbound calls, because the agent does not sign in to any skill queues.

4

The number of resting agents in a skill queue the agent signs in reaches the maximum.

Message Example

  • Request header
    Content-Type: application/json;charset=UTF-8
    Authorization: ******************
  • Request parameters
    {
        "ccId":1, 
        "vdn":170,
        "offset":0,
        "limit":3
    }
  • Response parameters
    {
        "result": "0",
        "resultCode": "0100000",
        "resultDatas": {
            "onRestAgentNum": 2,
            "allowRestAgentNum": 0,
            "details": [
                {
                    "agentId": 1034,
                    "cantRestCause": 2,
                    "vdnId": 170,
                    "ccId": 1,
                    "beginTime": 1602830642000,
                    "applyRestLength": 600,
                    "name": "zhang1130user"
                },
                {
                    "agentId": 1039,
                    "cantRestCause": 0,
                    "vdnId": 170,
                    "ccId": 1,
                    "beginTime": 1602830613000,
                    "applyRestLength": 600,
                    "name": "HW285601039",
                    "reqRestDura": 238
                },
                {
                    "agentId": 1099,
                    "cantRestCause": 0,
                    "vdnId": 170,
                    "ccId": 1,
                    "beginTime": 1602830638000,
                    "applyRestLength": 600,
                    "name": "HW285601099",
                    "reqRestDura": 213
                }
            ],
            "waitRestAgentNum": 1
        },
        "resultDesc": {
            "onRestAgentNum": 2,
            "allowRestAgentNum": 0,
            "details": [
                {
                    "agentId": 1034,
                    "cantRestCause": 2,
                    "vdnId": 170,
                    "ccId": 1,
                    "beginTime": 1602830642000,
                    "applyRestLength": 600,
                    "name": "zhang1130user"
                },
                {
                    "agentId": 1039,
                    "cantRestCause": 0,
                    "vdnId": 170,
                    "ccId": 1,
                    "beginTime": 1602830613000,
                    "applyRestLength": 600,
                    "name": "HW285601039",
                    "reqRestDura": 238
                },
                {
                    "agentId": 1099,
                    "cantRestCause": 0,
                    "vdnId": 170,
                    "ccId": 1,
                    "beginTime": 1602830638000,
                    "applyRestLength": 600,
                    "name": "HW285601099",
                    "reqRestDura": 213
                }
            ],
            "waitRestAgentNum": 1
        },
        "count": 30
    }