Manual audio review

Updated at:

This topic describes how to call the /green/voice/manual/asyncScan API operation to perform a manual review. In addition to automated detection, AI Guardrails offers a manual review service. You can use this service if you require very high accuracy and recall rates for your detection results.

Note

Before you use this service, contact your account manager to confirm the review standards and scope. This API operation does not return automated detection results. To obtain automated detection results, you must call a detection service API operation. For more information, see Synchronous detection of short audio files and Asynchronous audio detection.

Usage notes for manual audio review

API operation: /green/voice/manual/asyncScan

The manual review API operation does not return detection results in real-time. You can obtain the results using a callback or by polling. The detection results are retained for a maximum of 30 days.

  • Billing:

    This is a paid API operation. For more information about billing, see Content Moderation Pricing.

  • Response:

    The time required to return the manual review results depends on the amount of data to review.

    • Obtain review results using a callback: When you submit a manual review task, you can include the callback parameter in the request to automatically receive the detection results. For more information, see Request parameters.

    • Obtain review results by polling: If you do not include the callback parameter when you submit a manual review task, you must call the result query API operation to obtain the detection results after the task is submitted. For more information, see Result query API operation.

  • Audio file requirements:

    • The audio file must be smaller than 200 MB.

    • Supported audio file formats: MP3, WAV, AAC, WMA, OGG, M4A, AMR, AUDIO, and M3U8.

    • Video files with audio are supported in the following formats: AVI, FLV, MP4, MPG, ASF, WMV, MOV, RMVB, and RM.

For information about how to use this API operation, see Connect to the manual review service.

QPS limit

The queries per second (QPS) limit for this API is 50 per user. Exceeding this limit triggers throttling, which can impact your business. Plan your calls accordingly.

Request parameters for manual review

For information about the common request parameters that must be included in a request, see Common parameters.

The request body is a JSON struct that contains the following fields:

Name

Type

Required

Example

Description

callback

String

No

http://aliyundoc.com

The callback interface must support the POST method, UTF-8 encoded data, and the form parameters checksum and content. Content Moderation sets the checksum and content parameters according to the following rules and formats, and calls your callback interface to return the detection results.

  • checksum: A SHA-256 hash of the concatenated string User UID + seed + content. The user UID is your Alibaba Cloud account ID, which is available in the Alibaba Cloud console. To prevent tampering, regenerate this string on your end and verify it against the received checksum.

    Note

    The user UID must be that of the root account, not a RAM user.

  • content: A JSON string that you must parse. For an example of the content payload, see the sample response in "Query detection results".

Note

After your callback server receives a result notification, it must return an HTTP status code of 200 to indicate success. Any other status code is treated as a failure. If the notification fails, Content Moderation retries up to 16 times until it succeeds. If it still fails after 16 retries, no more attempts are made. We recommend that you check the status of your callback endpoint.

seed

String

Yes

seedxxx

A random string used for the signature in the callback notification request.

The string can contain letters, digits, and underscores (_), and must be 64 characters or less. Customize this string to verify the origin of callback requests.

Note

This parameter is required when you use a callback.

tasks

JSONArray

No

Specifies the detection objects. Each element in the JSON array is a detection task struct. You can specify up to 100 elements, which means you can submit 100 pieces of content for detection at a time. To support 100 elements, you must adjust the number of concurrent tasks to more than 100. For more information about the structure of each element, see task.

Table 1. task

Name

Type

Required

Example value

Description

url

String

Yes

http://aliyundoc.com/xxx.m4a

The URL of the object to detect.

  • A public HTTP or HTTPS URL. The URL cannot exceed 2,048 characters in length.

  • The path of a file stored in an Alibaba Cloud OSS bucket. You must first grant Content Moderation permissions to access the OSS bucket. The OSS bucket must be in the same region as the Content Moderation service. For more information, see Authorize Content Moderation to access an OSS bucket.

    File path format: oss://<bucket-name>.<endpoint>/<object-name>

dataId

String

No

dataIdxxxx

The data ID of the detection object.

This ID can contain uppercase and lowercase letters, digits, underscores (_), hyphens (-), and periods (.), and must be 128 characters or less. Use it to uniquely identify your business data.

Response parameters for manual review

Name

Type

Example

Description

code

Integer

200

The error code. It is the same as the HTTP status code.

For more information, see Common error codes.

data

JSONArray

The data returned for the request. Each element in the array represents the result of a manual review task. For more information about the structure of each element, see data.

msg

String

OK

The response information for the request.

requestId

String

9FEF3EBD-FBD0-40D9-AF04-C39259E6EEFA

The request ID.

Table 2. data

Name

Type

Sample value

Description

code

Integer

200

The error code. It is the same as the HTTP status code.

For more information, see Common error codes.

dataId

String

dataIdxxxx

The data ID of the detection object.

Note

If dataId was passed in the detection request, the same dataId is returned here.

msg

String

OK

The response information for the detection task.

taskId

String

vc_f_3M98sw5CQ8u5kLKSdrEyWR-1tyA08

The ID of the submitted review task.

url

String

http://aliyundoc.com/xxxx.m4a

The URL of the object to detect.

  • A public HTTP or HTTPS URL. The URL cannot exceed 2,048 characters in length.

  • The path of a file stored in an Alibaba Cloud OSS bucket. You must first grant Content Moderation permissions to access the OSS bucket. The OSS bucket must be in the same region as the Content Moderation service. For more information, see Authorize Content Moderation to access an OSS bucket.

    File path format: oss://<bucket-name>.<endpoint>/<object-name>

Examples for manual review

Request example

http(s)://[Endpoint]/green/voice/manual/asyncScan
&<Common request parameters>
{
    "seed": "seedxxx",
    "callback": "http://aliyundoc.com",
    "tasks": [{
        "dataId": "dataIdxxxx",
        "url": "http://aliyundoc.com/xxx.m4a"
    }]
}

Successful response example

{
    "code": 200,
    "data": [{
        "code": 200,
        "msg": "OK",
        "taskId": "vc_f_3M98sw5CQ8u5kLKSdrEyWR-1tyA08",
        "url": "http://aliyundoc.com/xxxx.m4a"
    }],
    "msg": "OK",
    "requestId": "9FEF3EBD-FBD0-40D9-AF04-C39259E6EEFA"
}

Usage notes for querying manual audio review results

API operation: /green/video/manual/scan/results. You can call this operation to query the results of a manual audio review.

QPS limit

The queries per second (QPS) limit for this API is 50 per user. Exceeding this limit triggers throttling, which can impact your business. Plan your calls accordingly.

Request parameters for result query

Name

Type

Required

Sample value

Description

body

StringArray

Yes

["vc_f_3M98sw5CQ8u5kLKSdrEyWR-1tyA08"]

A list of taskIds for the manual review tasks to query. The array can contain up to 100 elements.

Response parameters for result query

Name

Type

Example

Description

code

Integer

200

The error code. It is the same as the HTTP status code.

For more information, see Common error codes.

data

JSONArray

The data returned for the request. Each element in the array represents the result of a manual review task. For more information about the structure of each element, see data.

msg

String

OK

The response information for the request.

requestId

String

246E650C-0556-4404-AEFB-6CBBEA240DE5

The request ID.

Table 3. data

Name

Type

Sample value

Description

code

Integer

200

The error code. It is the same as the HTTP status code.

For more information, see Common error codes.

dataId

String

dataIdxxxx

The data ID of the detection object.

Note

If dataId was passed in the detection request, the same dataId is returned here.

msg

String

OK

The response information for the detection task.

suggestion

String

block

The recommended subsequent operation. Valid values:

  • pass: The result is normal. No other operation is required.

  • block: The result is a violation. Delete the content or restrict its public access.

taskId

String

vc_f_3M98sw5CQ8u5kLKSdrEyWR-1tyA08

The task ID.

url

String

http://aliyundoc.com/xxxx.m4a

The URL of the object to detect.

  • A public HTTP or HTTPS URL. The URL cannot exceed 2,048 characters in length.

  • The path of a file stored in an Alibaba Cloud OSS bucket. You must first grant Content Moderation permissions to access the OSS bucket. The OSS bucket must be in the same region as the Content Moderation service. For more information, see Authorize Content Moderation to access an OSS bucket.

    File path format: oss://<bucket-name>.<endpoint>/<object-name>

Examples for result query

Request example

http(s)://[Endpoint]/green/video/manual/scan/results
&<Common request parameters>
[
    "vc_f_3M98sw5CQ8u5kLKSdrEyWR-1tyA08"
]

Successful response example

{
    "code": 200,
    "data": [{
        "code": 200,
        "msg": "OK",
        "suggestion": "pass",
        "taskId": "vc_f_3M98sw5CQ8u5kLKSdrEyWR-1tyA08",
        "url": "http://aliyundoc.com/xxxx.m4a"
    }],
    "msg": "OK",
    "requestId": "246E650C-0556-4404-AEFB-6CBBEA240DE5"
}