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

Querying Call Information About All Agents in Batches

Description

This interface is invoked to query real-time call information about all agents in batches.

Interface Method

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

Internal Encapsulation Interfaces

BMS interface: /ccbms/ws/monitor/queryagentCalls

Request URL

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

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 to 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 3000.

The value ranges from 101 to 59999.

Response Message

Table 3 Parameters in the message body

No.

Parameter

Value Type

Description

1

resultCode

String

Query result. The options are as follows:

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

2

resultDesc

Array

Object array in the returned result after a successful query.

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

Table 4 Parameters of resultDesc

No.

Parameter

Value Type

Description

2.1

agentId

Integer

Agent ID.

2.2

callList

Array

Call information array.

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

Table 5 Parameters of callList

No.

Parameter

Value Type

Description

2.2.1

callId

String

Call ID.

2.2.2

callStatus

Integer

Call status. For details, see Table 6.

2.2.3

callInOut

Integer

Inbound and outbound call flags.

The value 0 indicates inbound call, and 1 indicates outbound call.

2.2.4

mediaType

Integer

Media type. For details, see Table 1.

Table 6 Call status

No.

Call Type

Description

0

IDLE

Indicates that the called party is idle (no call).

1

OCCUPY

Indicates that the called party is occupied.

2

QUEUE

Indicates that the call is queuing in a skill queue.

3

PRIVATE_QUEUE

Indicates that the call is queuing in a private skill queue.

4

ALERTING

Indicates that the phone of the called party rings and waits for answer.

5

TALK

Indicates that the calling and called parties are in conversation or interaction.

6

HOLD

Indicates that the call is held.

7

SUSPEND

Indicates that the call is suspended.

8

MUTE

Indicates that the call is muted.

9

TRITALK

Indicates that a three-party call is initiated.

Message Example

  • Request header
    Content-Type: application/json;charset=UTF-8
    Authorization: ******************
  • Request parameters
    {
        "ccId":1,
        "vdn":170,
        "agentIds":[1031,1099]
    }
  • Response parameters
    {
      "resultCode": "0100000",
      "resultDesc": [
        {
          "agentId": 1034,
          "callList": []
        },
        {
          "agentId": 1099,
          "callList": [
            {
              "callId": "1605494261-1449",
              "callStatus": 5,
              "callInOut": 0,
              "mediaType": 5
            }
          ]
        }
      ]
    }