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

Generating a File Hash Value as a Third Party

Description

This API is invoked by a third party to generate the hash value of an uploaded file. The third-party system is connected to the IVR system by loading a customized JAR package.

Usage Description

Interface Method

POST

URI

https://ip:port/CCFS/resource/ccfs/ivr/getFileHash

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

Full path of the file whose hash value needs to be obtained. The file path is specified by the system parameter Third-Party Upload File Path Rule. Contact the system administrator to obtain the value of the system parameter in Configuration Center > System Management > System Parameter Configuration > System parameters > File storage service > Path Configuration > Third-Party Upload File Path Rule. The default value is /3rdfile/%VDNNO%/thirdvoicebotfile/.

Example: {Drive letter}:/3rdfile/{VDN ID}/thirdvoicebotfile/xxx.wav

2

locationId

String

No

None

This parameter is valid only in CTI pool mode.

Response

If this interface is successfully invoked, 0 and the message "operate success" are returned.

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. For details, see Table 5.

Table 5 Description of resultData in the response message

No.

Name

Value Type

Description

3.1

hashValue

String

String of the voice file after SHA256 encoding.

Example

  • Request header
    POST /CCFS/resource/ccfs/ivr/getFileHash HTTP/1.1
    Authorization: auth-v2/ak/2021-08-31T09:38:50.872Z/content-length;content-type;host/c12f0ed0******************494941bdd106
    Accept: */*
    Content-Type: application/json;charset=UTF-8
    Content-Length: 193
  • Request parameters
    {
        "request": {
            "version": "2.0"
        },
        "msgBody": {
            "fileName": "Y:/3rdfile/2/thirdvoicebotfile/5dckNDei_1647502396161.wav"
        }
    }
  • Response parameters
    {
        "resultData": {
            "hashValue": "2b67748fe335617******************cf19f28bb8"
        },
        "resultCode": "0",
        "resultDesc": "success"
    }