Updated on 2023-09-27 GMT+08:00

Generating Indexes of Agent Operation Details

Description

This interface is invoked to generate an index file of agent operation details based on the conditions. After a file is generated, the file name (agentOprInfoFileName) is sent to the callback URL carried by callBackURL in callback mode.

The callback of the URL specified by callBackURL requires authentication. For details, see C2 Monitoring, System Outbound Call, CDR, and Knowledge Base Interface Authentication.

Usage Description

  • Prerequisites
    • The developer environment has been established and agents can sign in and perform operations properly. The developer has an independent server and the server has been bound to the callback URL (callBackURL).
    • The accountId and agentId can be freely combined to generate an index file for the agent operation details. If neither of the parameters is specified, the corresponding data records of the appId in the specified period are generated.
    • You have passed the authorization and obtained the access URL.
    • You have set aicc.ssl.trustAll in the CC-FS configuration file /home/ccfsapp/webapps/ccfsapp/WEB-INF/classes/config/servicecloud.base.properties is to false and performed the following steps to place the certificate:
      1. Log in to the CC-FS server as an O&M user and switch to the root user.
        su - root
      2. Upload the third-party certificate that needs to be loaded by the callback URL for notifying the index file generated by the CC-FS to the same directory ($HOME/conf) as the truststore.jks certificate file of the AICC. The directory varies according to the actual environment.
      3. Change the owner group of the uploaded third-party certificate.
        chown ccfsapp:ccfsapp XXX.jks
      4. Import the third-party certificate to truststore.jks.
        keytool -import -alias xxx -file XXX.jks -keystore truststore.jks

        Enter the password of the truststore.jks certificate file as prompted.

      5. Delete the XXX.jks certificate from the environment.
      6. Restart the CC-FS.

        Go to the /home/ccfsapp/bin directory and run the following command:

        ./shutdown.sh;./startup.sh
  • Usage restrictions

    A developer can access only the data of the account. The developer account (appId) must correspond to the enterprise account (accountId).

    The developer account is contained in the authentication string. For details, see C2 Monitoring, System Outbound Call, CDR, and Knowledge Base Interface Authentication.

Interface Method

POST

URI

https://ip:port/CCFS/resource/ccfs/queryAgentOprInfoData

Set ip to the IP address of the server where the CC-FS is installed and port to the HTTPS port number of the CC-FS.

If the request is routed through the NSLB, set ip to the IP address of the NSLB server and port to the HTTPS port number of the CC-FS service mapped on the NSLB.

Request

Table 1 Parameters in the request header

No.

Name

Value Type

Mandatory

Default Value

Description

1

Content-Type

String

Yes

None

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

2

Authorization

String

Yes

None

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

Table 2 request parameters in the request body

No.

Name

Value Type

Mandatory

Default Value

Description

1

version

String (1–32)

Yes

2.0

Protocol version. Currently, the value is fixed to 2.0.

Table 3 msgBody parameters in the request body

No.

Name

Value Type

Mandatory

Default Value

Description

1

beginTime

String

Yes

None

Start time of agent operations, which is the time in the time zone where the tenant space is located. The interval between the start time and end time cannot exceed three days. The time is in yyyy-MM-dd HH:mm:ss format.

2

endTime

String

Yes

None

End time of agent operations, which is the time in the time zone where the tenant space is located. The interval between the start time and end time cannot exceed three days. The time is in yyyy-MM-dd HH:mm:ss format.

3

accountId

String (1–20)

No

None

Enterprise account (tenant space ID).

4

agentId

String (1–20)

No

None

Agent ID.

5

callBackURL

String

Yes

None

Callback URL. After generating a data record file, the platform returns fileName to the URL specified by this parameter.

Response

The response obtained by invoking this interface consists of two parts:

(1) Response of the invoked party

(2) Response of the invoking part (response to third-party callback)

  • Response of the invoked party

    Table 4 describes the parameters in the response.

  • Response of the invoking party (response to third-party callback)

    The response consists request and msgBody. Table 7 describes msgBody parameters.

    request contains version (2.0 by default).

    msgBody consists of responseId (part of the agent operation details file name), fileName (name of the ZIP package of agent operation details to be downloaded), and accountId (tenant space ID).

Table 4 Parameters in the response

No.

Name

Value Type

Description

1

resultCode

String

Result code returned.

2

resultDesc

String

Request result description.

3

resultData

Object

For the description about parameters in resultData, see Table 5.

4

response

Object

Request result object. For details, see Table 6.

This field is reserved for compatibility with earlier versions and is not recommended.

Table 5 Description of resultData in the response message

No.

Name

Value Type

Description

3.1

responseId

String

Unique ID generated after the interface is successfully invoked. It is a part of the file name.

Table 6 Parameters in a response message

No.

Name

Value Type

Description

4.1

version

String (1–32)

Protocol version, for example, 2.0.

4.2

resultCode

String (1–32)

Result code returned. For details, see Error Code Reference.

4.3

resultMsg

String

Request result description.

Table 7 msgBody parameters in the callback response body

No.

Name

Value Type

Description

1

responseId

String

Unique ID generated after the interface is successfully invoked. It is a part of the file name.

2

fileName

String

Name of a CDR or recording index file. The value is in yyyyMMdd_{responseId}.zip format.

For example, if the date when this interface is invoked is 2018-07-02 and the obtained value of responseId is 9239cb50a8384bb0ab503441bf089446, the value of this parameter is 20180702_9239cb50a8384bb0ab503441bf089446.zip.

3

accountId

String

Enterprise account (tenant space ID). The enterprise account carried in the request parameter is used to associate the file name with an enterprise. If accountId is not set in the request parameter, this value is not returned.

Example

  • Request header
    POST /CCFS/resource/ccfs/queryAgentOprInfoData HTTP/1.1
    Authorization: auth-v2/ak/2018-07-02T02:42:49Z/content-length;content-type;host
    /7a8fb9d620e******************5c5df0cce3c6a253
    Accept: */*
    Host: 10.154.198.164
    Content-Type: application/json;charset=UTF-8
    Content-Length: 297
  • Request parameters
    {
        "request": {
            "version": "2.0"
        },
        "msgBody": {
            "beginTime": "2018-06-29 10:42:49",
            "endTime": "2018-07-02 10:42:49",
            "accountId": "",
            "agentId": "",
            "callBackURL": "https://10.57.118.171:8000"
        }
    }
  • Response header
    HTTP/1.1 200 OK
    Content-Type: application/json;charset=UTF-8
    Date: Mon, 02 Jul 2018 02:43:03 GMT
  • Response parameters
    {
        "resultData": {
            "responseId": "9239cb50a8384bb0ab503441bf089446"
        },
        "resultCode": "0",
        "resultDesc": "success"
    }
  • Example of the message returned by the call center to the callback URL

    Message header:

    POST / HTTP/1.1
    Accept: */*
    Content-Type: application/json;charset=UTF-8
    Authorization: auth-v2/ak/2018-07-02T02:43:03Z/content-length;content-type;host
    /c5bd683******************ef5747bd572c28
    Host: 10.57.118.171
    Content-Length: 208

    Message parameters:

    {
        "request": {
            "version": "2.0"
        },
        "msgBody": {
            "responseId": "9239cb50a8384bb0ab503441bf089446",
            "agentOprInfoFileName": "20180702_9239cb50a8384bb0ab503441bf089446.zip"
        }
    }