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

Offline Conversion Callback Interface

Description

This interface is provided by the OIAP for a third-party system to return the ASR offline conversion result to the ODFS.

This interface is a system-level third-party interface. For details about the authentication mode, see the third point in "NOTE" in C3 OIAP Interface Authentication.

Interface Method

POST

URI

https://IP:PORT/oifde/rest/sysapi/asrcallback

Message Header

Table 1 Request header parameters

No.

Parameter

Type

Mandatory

Description

1

Content-Type

String

Yes

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

2

userName

String

Yes

For details, see the appKey description in the third point in "NOTE" in C3 OIAP Interface Authentication.

3

token

String

Yes

For details about the generation mode, see C3 OIAP Interface Authentication.

Request

Table 2 Parameters in the request body

No.

Parameter

Type

Mandatory

Description

1

Body

Object

Yes

Result to be written back.

Table 3 describes the parameters of this object.

Table 3 Description of body parameters

No.

Parameter

Type

Mandatory

Description

1.1

state

Object

Yes

Conversion status.

Table 4 describes the parameters of this object.

1.2

Body

Object

Yes

Writeback result body.

Table 5 describes the parameters of this object.

Table 4 Description of state parameters

No.

Parameter

Type

Mandatory

Description

1.1.1

code

String

Yes

Conversion result code.

1.1.2

success

Boolean

Yes

Whether the conversion is successful. The options are true (success) and false (failure).

Table 5 Description of body parameters

No.

Parameter

Type

Mandatory

Description

1.2.1

aid

String

Yes

Unique ID of an audio file, which is passed by the client.

1.2.2

lattices

List

Yes

Conversion result.

Table 6 describes the parameters of this object.

Table 6 Description of lattices parameters

No.

Parameter

Type

Mandatory

Description

1.2.2.1

lid

Integer

Yes

Sequence number of a segment.

1.2.2.2

begin

Integer

Yes

Start time of a segment.

1.2.2.3

end

Integer

Yes

End time of a segment.

1.2.2.4

onebest

String

Yes

Text after conversion.

1.2.2.5

spk

Integer

Yes

Role of the speaker.

Response

  • Status code: 200
    Table 7 Parameters in the response body

    No.

    Parameter

    Type

    Description

    1

    retCode

    String

    Result code. The value 0 indicates success and other values indicates failure.

    2

    retMsg

    String

    Failure cause.

  • Status code: 400

    Incorrect request. Check the request path and parameters.

  • 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

    The requested content is not found. Check the request path.

  • Status code: 500

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

Error Codes

None

Example

Request header:

Content-Type:application/json; charset=UTF-8
userName:ODFS_SYS_OPENAPI
token:********************
Request body:
{
	"body": {
		"state": {
			"code": 0,
			"success": true
        },
		"body": {
			"aid": "FJKkMeepk8l",
			"lattices": [{
				"begin": 4360,
				"end": 5970,
				"lid": 0,
				"onebest": "Hello, is the call connected?",
				"spk": 0
            }]
        }
    }
}
Response body:
{
  "retCode": "0",
  "retMsg": "success"
}