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

Downloading a Recording File (Extended)

Description

This interface is invoked to query and download a recording file by call ID or file name.

Intended audience: This interface is invoked by a third-party server and can be used in scenarios such as dumping.

Usage Description

  • Prerequisites
    • Recording index files have been obtained by invoking the interface for downloading CDRs and recording indexes.
    • You have passed the authorization and obtained the access URL.
  • Usage restrictions

    Developers can only download files under their own accounts. The developer account (appId) must correspond to the original recording file name (fileName).

    The developer account (appId) 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/downloadRecord

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

fileName

String (1–225)

No

None

Recording file name, which is obtained from the original_file_name field in the recording index file returned when the interface for downloading CDRs and recording indexes is invoked.

For example, the value is X:/4/0/20180416/512/1629533.V3. Note: Either fileName or callId must be set.

2

callId

String (1–25)

No

None

Call ID. Note: At least one of fileName and callId must be set. If callid corresponds to multiple recording files, the .zip package will be downloaded.

3

ccId

String (1–64)

No

None

ID of a call center. The default value is 1.

Response

If the interface is successfully invoked, the system obtains the binary data of the file from the HTTP response message to generate a recording file. The file name extension is .wav. If multiple recording files are downloaded by callid, the file name extension is .zip. In the response message, the value of content-type is Application/Octet-stream;charset=UTF-8.

If the interface fails to be invoked, an error code is returned. For details about the error code data structure, see Table 4. resultData is a reserved field and is left empty by default.

Table 4 Parameters in the response

No.

Name

Value Type

Description

1

resultCode

String

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

2

resultDesc

String

Request result description.

3

resultData

Object

Response data.

4

response

Object

Request result object. For details, see Table 5.

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

Table 5 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.

Example

  • Request header
    POST /CCFS/resource/ccfs/downloadRecord HTTP/1.1
    Authorization: auth-v2/ak/2018-07-02T02:44:42Z/content-length;content-type;host
    /f18f6dd19******************6b8ff99f6c5884
    Accept: */*
    Host: 10.154.198.164
    Content-Type: application/json;charset=UTF-8
    Content-Length: 185
  • Request parameters
    {
        "request": {
            "version": "2.0"
        },
        "msgBody": {
            "fileName": "Y:/autoTest.V3",
            "callId": "autoTest-1",
            "ccId": "1"
        }
    }