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

Querying Agent Information in Batches

Scenario

This interface is invoked to query information about specified agents in batches.

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

CTI3.8: BMS interface: /ccbms/ws/monitor/queryAgentStatusEx3Message

Request URL

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

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

agentIds

Array

Yes

Array of agent IDs. The maximum length of the array is 6000.

The value ranges from 101 to 59999.

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

Array

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.

2

resultDesc

Array

Object array in the returned result after a successful query.

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

Table 4 Parameters of resultDesc/resultDatas

No.

Parameter

Value Type

Description

2.1

agentId

Integer

Agent ID.

2.2

locationId

Integer

Home distributed access node.

2.3

currentStateReason

Integer

Reason for the current state. Currently, this parameter is valid for only the rest state.

2.4

prevState

Integer

Previous status. For details, see CTI Platform Agent Status Code Reference.

2.5

prevStateTime

Long

Duration of the previous state, in seconds.

2.6

currentState

Integer

Current status. For details, see CTI Platform Agent Status Code Reference.

2.7

currentStateTime

Long

Duration of the current state, in seconds.

2.8

logonTime

Long

Sign-in time (millisecond-level timestamp).

NOTE:

If an agent in the query result has not signed in, the value is a future time (in 2106).

2.9

agentRelease

Integer

Number of times that an agent proactively releases calls.

2.10

currentPrivateCallNum

Integer

Number of private calls of an agent.

Message Example

  • Request header
    Content-Type: application/json;charset=UTF-8
    Authorization: ******************
  • Request parameters
    {
        "ccId":1,
        "vdn":170,
        "agentIds":[1031,1099]
    }
  • Response parameters
    {
        "result": "0",
        "resultCode": "0100000",
        "resultDatas": [
            {
                "prevState": 1,
                "agentId": 1031,
                "logonTime": 4294967295000,
                "agentRelease": 0,
                "locationId": 65535,
                "currentPrivateCallNum": 0,
                "currentStateTime": 2224439,
                "currentStateReason": 65535,
                "prevStateTime": 4294967295,
                "currentState": 0
            },
            {
                "prevState": 1,
                "agentId": 1099,
                "logonTime": 4294967295000,
                "agentRelease": 0,
                "locationId": 65535,
                "currentPrivateCallNum": 0,
                "currentStateTime": 230703,
                "currentStateReason": 258,
                "prevStateTime": 4294967295,
                "currentState": 0
            }
        ],
        "resultDesc": [
            {
                "prevState": 1,
                "agentId": 1031,
                "logonTime": 4294967295000,
                "agentRelease": 0,
                "locationId": 65535,
                "currentPrivateCallNum": 0,
                "currentStateTime": 2224439,
                "currentStateReason": 65535,
                "prevStateTime": 4294967295,
                "currentState": 0
            },
            {
                "prevState": 1,
                "agentId": 1099,
                "logonTime": 4294967295000,
                "agentRelease": 0,
                "locationId": 65535,
                "currentPrivateCallNum": 0,
                "currentStateTime": 230703,
                "currentStateReason": 258,
                "prevStateTime": 4294967295,
                "currentState": 0
            }
        ]
    }