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

Requesting to Play Back a Recording File

Description

After this API is invoked, the backend verifies the recording file name. If the verification is successful, a token is returned for Playing Back a Recording File.

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 play recording files under their own accounts. The developer account (appId) must correspond to the 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/requestPlayVoice

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

Yes

None

Relative path of the recording file, 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.

Note: The backslash (\) in fileName needs to be changed to a slash (/).

Response

If the interface is invoked successfully, a response is returned. In the response, the value of resultCode is 0, and the value of resultMsg is success.

For details about the response data structure, see Table 4. The resultData parameter carries the token.

If the interface fails to be invoked, an error code is returned. The default value of resultData is null.

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

Response data. For details, 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

token

String

After this interface is successfully invoked, the token is used for authentication for Playing Back a Recording File. The token is valid for 30 minutes.

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.

Example

  • Request header
    POST /CCFS/resource/ccfs/requestPlayVoice HTTP/1.1
    Authorization: auth-v2/taikang/2018-07-02T02:42:49Z/content-length;content-type;host /7a8fb9d6******************5df0cce3c6a253
    Accept: */*
    Host: 10.154.198.164:18084
    Content-Type: application/json;charset=UTF-8
  • Request parameters
    {
        "request": {
            "version": "2.0"
        },
        "msgBody": {
            "fileName": "Y:/1/0/20180309/108/2022318.V3"
        }
    }
  • 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": {
            "token": "DC45F******************6D46F90"
        },
        "resultCode": "0",
        "resultDesc": "success"
    }