Help Center/ Cognitive Engagement Center/ API Reference/ Chatbot Management Interface Reference/ Interface for Pushing Packet Capture Recording Request Results
Updated on 2023-09-27 GMT+08:00

Interface for Pushing Packet Capture Recording Request Results

When controlling the audio and video recording server for recording, the ODFS only enables the audio and video recording server to forward the ASR result. Therefore, an interface needs to be provided for the audio and video recording server to receive the continuously reported recognition results.

Interface Method

POST

URL

https://IP:PORT/oifde/rest/api/flow/asrrecognizeresult

Message Header

Content-Type:application/json; charset=UTF-8

Request

Table 1 Parameters in the request body

Parameter

Type

Position

Mandatory

Description

serviceToken

String

Body

Yes

Authentication token. It is the same as the serviceToken field carried in the VoiceCyber request recognition interface (transfertoasr) invoked by the OIAP.

subCCID

String

Body

No

ID of a call center.

taskID

String

Body

Yes

ID used for capturesession.

Unique call ID used in the request (inaction=7) for starting packet capture recording in a dialog. The value is the same as those of userid and call_id and is used by the flow.

NOTE:

For details about capturesession, see the interface reference provided by the corresponding audio and video recording server.

respType

String

Body

Yes

NormalResult: The user ends the speech normally.

StartSpeech: The user starts to speak.

The default value is StartSpeech.

sentence

JSON object

Body

Yes

ASR result. For details, see Table 2.

analysis

JSON object

Body

No

Object inspection analysis information. For details, see Table 3.

speakerID

String

Body

No

ID of the speaker, which is used during the manual call.

0: customer

1: agent

2: others

The default value is 0.

Table 2 sentence

Parameter

Type

Position

Mandatory

Description

st

Integer

Body

Yes

Start timestamp of a sentence, in milliseconds.

et

Integer

Body

Yes

End timestamp of a sentence, in milliseconds.

isFinal

Boolean

Body

Yes

The value true indicates that the result is the final result, and the value false indicates that the result is the intermediate temporary result.

text

String

Body

Yes

Text in the recognition result.

text = URLEncoder.encode(text, "UTF-8");

confidence

Float

Body

Yes

Confidence of the recognition result. The value ranges from 0 to 1. The value 0 indicates the intermediate result.

Table 3 analysis

Parameter

Type

Position

Mandatory

Description

emotions

emotion[]

Body

No

Emotion information array. If the value of checkEmotion is false or no emotion information is detected, this field is invalid.

NOTE:

For details about checkEmotion, see the interface reference provided by the corresponding audio and video recording server.

avgVol

Integer

Body

No

Average volume. If the value of outputVolume is false, this parameter is invalid.

NOTE:

For details about outputVolume, see the interface reference provided by the corresponding audio and video recording server.

maxVol

Integer

Body

No

Maximum volume. If the value of outputVolume is false, this parameter is invalid.

speed

Integer

Body

No

Speaking speed. If the value of outputSpeed is false, this parameter is invalid.

NOTE:

For details about outputSpeed, see the interface reference provided by the corresponding audio and video recording server.

Table 4 emotion

Parameter

Type

Position

Mandatory

Description

st

Integer

Body

Yes

Audio start time, in milliseconds.

et

Integer

Body

Yes

Audio end time, in milliseconds.

c

Float

Body

Yes

Confidence. The value ranges from 0.0 to 1.0.

e

String

Body

No

Emotion. The value can be HAPPY, ANGRY, SAD, or DISGUSTED, which varies with the ASR vendor.

Response

Parameter

Type

Position

Mandatory

Description

retCode

String

Body

Yes

Error code.

0: success

Other values: failure

retMsg

String

Body

Yes

Description.

Example

  • Request
    { 
       "serviceToken":"160*******************bbb489426",
       "subCCID":"10001",
       "taskID":"node_action_97511fbc15d9b23074405ee736187a82c529",
       "respType":"StartSpeech",
       "sentence":{
          "st":1
          "et":2
          "isFinal":true
          "text":"sdffasdfaedfasdfasdfsad"
          "confidence":0
       }
     }
  • Response
    { 
         "retCode" : "0",
         "retMsg":"asr recognize success" 
    }