SecretAsrReport

Updated at:

Subscribe to ASR status reports (SecretAsrReport) through HTTP batch pushes to receive real-time speech-to-text results during calls.

Protocol specifications

Parameter

Description

Protocol

HTTP + JSON

Encoding

UTF-8

Request

The request body is a JSON array. A single request can contain multiple call records.

Request example

[{
    "callId": "44611dd0c30****",
    "bizDuration": 9140,
    "secretNo": "170****0000",
    "partnerKey": "FC10000011988****",
    "sentences": [{
        "beginTime": 640,
        "channelId": 1,
        "emotionValue": "5.5",
        "endTime": 1850,
        "silenceDuration": "0",
        "speechRate": "148",
        "text": "Hello."
    }, {
        "beginTime": 770,
        "channelId": 0,
        "emotionValue": "5.8",
        "endTime": 4480,
        "silenceDuration": "0",
        "speechRate": "194",
        "text": "Hello."
    }, {
        "beginTime": 3160,
        "channelId": 1,
        "emotionValue": "3.7",
        "endTime": 4120,
        "silenceDuration": "0",
        "speechRate": "62",
        "text": "Hey."
    }],
    "statusCode": "21050000"
}]

Parameters

Name

Type

Required

Example

Description

callId

String

Yes

44611dd0c307****

The callId of the corresponding call record.

Note

The callId can be up to 100 characters in length.

bizDuration

Long

Yes

1200

The total duration of the recognized audio file, in milliseconds.

partnerKey

String

Yes

FC10000011988****

The key of the partner who owns the AXB number.

secretNo

String

Yes

170****0000

The privacy number, which is the X number.

statusCode

String

Yes

21050000

The status code. A value of 21050000 indicates that the request was successful.

sentences

List<SecretAsrSentenceDTO>

Yes

[{"beginTime":1020,"channelId":0,"emotionValue":"5.7","endTime":1770,"silenceDuration":"0","speechRate":"80","text":"Hello"}]

The ASR results.

endTime

SecretAsrSentenceDTO.Long

Yes

1700

The end time offset of the sentence, in milliseconds.

silenceDuration

SecretAsrSentenceDTO.String

Yes

0

The duration of silence between this sentence and the previous one, in seconds.

beginTime

SecretAsrSentenceDTO.Long

Yes

1020

The start time offset of the sentence, in milliseconds.

text

SecretAsrSentenceDTO.String

Yes

Hello

The recognized text of the sentence.

channelId

SecretAsrSentenceDTO.Integer

Yes

0

The ID of the audio track to which the sentence belongs.

speechRate

SecretAsrSentenceDTO.String

Yes

80

The average speech rate of the sentence, in words per minute.

emotionValue

SecretAsrSentenceDTO.String

Yes

5

The emotion energy value, from 1 to 10.

Note

A higher value indicates a stronger emotion.

Response

Response example

{
  "code" : 0,
  "msg" : "Received successfully"
}

Parameters

Parameter

Type

Required

Example

Description

code

Number

Yes

0

The response code.

msg

String

No

Received successfully

The response message.

Note
  • The system only verifies that the code value in the response body is a number; the msg content is not validated. A push is considered successful if your service responds with an HTTP status code of 200. If the status code is not 200 or the request times out, the system retries the push.

  • If your service experiences an internal error or is unable to process the message, respond with an HTTP 5xx status code. This signals a failure and triggers a retry.

Retries

If an initial push attempt fails, the system retries up to three times at intervals of 1, 5, and 10 minutes. After three unsuccessful retries, the system makes no further attempts.