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

POST /CCISQM/rest/ccisqm/v1/openapi/voice2Text

Scenario

This interface is invoked to convert a recording file to text.

Method

POST

URI

https://Domain name/apiaccess/CCISQM/rest/ccisqm/v1/openapi/voice2Text (For example, the domain name is service.besclouds.com.)

Request Description

Table 1 Request header parameters

No.

Parameter

Type

Mandatory or Not

Description

1

Content-Type

String

No

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

2

x-app-key

String

No

App key. Contact operations personnel to obtain it.

3

Authorization

String

Yes

Authentication field. The format is Bearer {Value of AccessToken returned by the tokenByAkSk interface}. (A space is required after Bearer.)

Table 2 Request body parameters

No.

Parameter

Type

Mandatory or Not

Description

1.1

language

String

Yes

Language of the recording file. The options are zh_CN (Chinese) and en_US (English).

1.2

voiceFilePath

String

Yes

Recording file path

1.3

agentId

Number

Yes

Agent ID

1.4

beginTime

String

Yes

Call start time, in yyyy-MM-dd HH:mm:ss format

1.5

endTime

String

Yes

Call end time, in yyyy-MM-dd HH:mm:ss format

Response Description

  • Status code: 200
Table 3 Response body parameters

No.

Parameter

Type

Mandatory or Not

Description

1.1

resultCode

String

Yes

Response status code

1.2

resultDesc

String

Yes

Response status message

1.3

taskId

String

No

ID of the created task

1.4

duration

String

No

Audio duration, in seconds

  • Status code: 400

    The requested content is not found. Check the request path and parameter values.

  • Status code: 401

    Unauthorized operation. 1. Check whether you have purchased related services. 2. Contact customer service to check the status of your account.

  • Status code: 404

    Unauthorized operation. 1. Check whether you have purchased related services. 2. Contact customer service to check the status of your account.

  • Status code: 500

    Business failure. Check the values of parameters in the request.

Error Codes

None

Example

  • Scenario: Convert a recording file to text.

    Request header:

    x-app-key:************************************ 
    Authorization:Bearer ************************************

    Request parameters:

    {
    	"language": "zh_CN",
    	"voiceFilePath": "Y:\\27\\0\\20210201\\1118\\0951044.V3",
    	"agentId": 1118,
    	"beginTime": "2021-02-01 09:51:07",
    	"endTime": "2021-02-01 09:57:57"
    }

    Response parameters:

    {
        "resultCode": "1010200",
    	"resultDesc": "success",
    	"taskId": "608ba63d00000982",
    	"duration": "20",
    }