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

Querying Agent Rest Information

Scenario

This interface is invoked to query all agent rest information.

Interface Method

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

Internal Encapsulation Interface

  • CTI3.6 BMS interface: /ccbms/ws/monitor/teamrestinfo
  • CTI3.6 BMS interface: /ccbms/ws/monitor/teamrestagentinfo
  • CTI3.8 BMS interface: /ccbms/ws/monitor/queryAgentRestDetailInfo

Request URL

https://ip:port/rest/cmsapp/v1/openapi/agentgroup/agentrestinfos

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 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

offset

Integer

No

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.

This field is valid only in CTI3.6.

4

limit

Integer

No

Number of query records on each page.

The value ranges from 1 to 100.

limit and offset must exist or not exist at the same time.

This field is valid only in CTI3.6.

Response Description

Table 3 Parameters in the 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 array in the returned result after a successful query.

For details about the parameters of the object in this array, 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.

Table 4 Parameters of resultDesc/resultDatas

No.

Parameter

Value Type

Description

2.1

allowRestNum

Integer

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

2.2

onRestNum

Integer

Number of agents that are resting.

2.3

waitRestNum

Integer

Number of agents who apply for a rest.

2.4

agentsRestDetails

Array

List of details about agents who take a rest in the VDN.

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

Table 5 Parameters of agentsrestdetails

No.

Parameter

Value Type

Description

2.4.1

agentName

String

Agent name.

2.4.2

workNo

Integer

Agent ID.

2.4.3

cantRestReason

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.4

beginTime

Long

Start time. For resting agents, this parameter indicates the rest start time. For agents who are not in rest, this parameter indicates the requested or approved rest start time. The value is in the timestamp format.

2.4.5

restDuration

Long

Requested rest duration, in seconds.

Table 6 Reason for not allowing rest

No.

Value of the Reason for Not Allowing Rest

Description

2.4.3.1

0

The agent is waiting for approval.

2.4.3.2

1

The agent is in busy state.

2.4.3.3

2

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

2.4.3.4

3

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

2.4.3.5

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
    {
        "queryParam":
        {
            "ccId":1, 
            "vdn":1,
            "offset":0,
            "limit":100
        }
    }
  • Response parameters
    {
        "result": "0",
        "resultCode": "0100000",
        "resultDatas": {
            "allowRestNum": 101,
            "onRestNum": 1,
            "waitRestNum": 0,
            "agentsRestDetails": [
                {
                    "agentName": "z1",
                    "workNo": 55001,
                    "cantRestReason": 1,
                    "beginTime": 2345,
                    "restDuration": 22333
                }
            ]
        },
        "resultDesc": {
            "allowRestNum": 101,
            "onRestNum": 1,
            "waitRestNum": 0,
            "agentsRestDetails": [
                {
                    "agentName": "z1",
                    "workNo": 55001,
                    "cantRestReason": 1,
                    "beginTime": 2345,
                    "restDuration": 22333
                }
            ]
        }
    }