This topic describes how to call the /green/video/manual/asyncScan operation to submit videos for manual review. In addition to machine-based detection, AI Guardrails also provides a manual review service. Use the manual review feature if you require high accuracy and recall rates.
Before you use this service, contact our account manager to confirm the review standards and content scope. This API call does not return machine detection results. If you need machine detection results, call the detection service API. For more information about the detection service API, see Synchronous Detection and Asynchronous Detection.
Instructions for manual video review
Operation: /green/video/manual/asyncScan
This manual review operation does not return detection results in real time. You need to obtain the results through a callback or by polling. The detection results are retained for a maximum of 30 days.
-
Billing information:
You are charged for calling this operation. For more information about the billing methods, see
-
Return results:
The time required to return manual review results depends on the amount of data to be reviewed.
-
Obtaining review results using a callback: When you submit a manual review task, include the callback parameter in the request parameters to automatically receive the review results. For more information, see Request parameters.
-
Polling to retrieve review results: When you submit a manual review task, you do not need to pass the callback parameter. After you submit the task, call the result query API to retrieve the detection results. For more information, see Result Query API.
-
-
Video file requirements:
-
The video file URL must use the HTTP or HTTPS protocol.
-
The video file must be in one of the following formats: AVI, FLV, MP4, MPG, ASF, WMV, MOV, WMA, RMVB, RM, FLASH, or TS.
-
The size of a single video cannot exceed 200 MB.
-
Make sure that the storage service where the video files are stored is stable and reliable. We recommend that you use Alibaba Cloud Object Storage Service (OSS) to store your video files.
-
For more information about how to use this operation, see Connect to the manual review service.
QPS limits
You can call this operation up to 50 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
Request parameters (Manual review)
For more 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://www.aliyundoc.com |
If you set the callback parameter in the moderation request, make sure that the specified HTTP or HTTPS URL meets the following requirements: supports the POST method, uses UTF-8 to encode the transmitted data, and supports the checksum and content parameters. To send moderation results to the specified callback URL, Content Moderation returns the checksum and content parameters in callback notifications based on the following rules and format:
Note If your server successfully receives a callback notification, the server sends an HTTP 200 status code to Content Moderation. If your server fails to receive a callback notification, the server sends other HTTP status codes to Content Moderation. If your server fails to receive a callback notification, Content Moderation continues to push the callback notification until your server receives it. Content Moderation can push a callback notification repeatedly up to 16 times. After 16 times, Content Moderation stops pushing the callback notification. In this case, we recommend that you check the status of the callback URL. |
|
seed |
String |
Yes |
seedxxx |
A random string that is used to generate a signature for the callback notification request. The string can be up to 64 characters in length and can contain letters, digits, and underscores (_). You can customize this string. It is used to verify the callback notification request when Content Moderation pushes callback notifications to your server. Note This parameter is required if you set the callback parameter. |
|
tasks |
JSONArray |
No |
Specifies the detection objects. Each element in the JSON array is a detection task struct. You can specify a maximum of 100 elements to submit up to 100 content items for detection in a single request. To support the maximum of 100 elements, you must set the number of concurrent tasks to 100 or more. For a detailed description of the structure of each element, see task. |
|
Name |
Type |
Required |
Example |
Description |
|
url |
String |
Yes |
http://www.aliyundoc.com/xxx.mp4 |
of the object to be detectedURL.
|
|
dataId |
String |
No |
dataIdxxxx |
The ID of the moderation object. The ID can contain letters, digits, underscores (_), hyphens (-), and periods (.). It can be up to 128 characters in length. This ID uniquely identifies your business data. |
Returned data (manual review)
|
Name |
Type |
Example |
Description |
|
code |
Integer |
200 |
The returned HTTP status code. For more information, see Common error codes. |
|
data |
JSONArray |
The data body that is returned for the request. Each element in the array represents the result of a manual review task. For a detailed description of the structure of each element, see data. |
|
|
msg |
String |
OK |
The message returned for the request. |
|
requestId |
String |
6CB46796-65F0-4CB1-9C7A-D64CC3108436 |
The request ID. |
|
Name |
Type |
Example |
Description |
|
code |
Integer |
200 |
The returned HTTP status code. For more information, see Common error codes. |
|
dataId |
String |
dataIdxxxx |
The ID of the moderation object. Note If you set the dataId parameter in the moderation request, the value of the dataId request parameter is returned here. |
|
msg |
String |
OK |
The message returned for the detection task. |
|
taskId |
String |
vi3tGoJ2zb45O5dQ7GAg1c32-1tyzXJ |
The ID of the manual review task. You can use this ID to call the result query operation to query the result of the manual review task. |
|
url |
String |
http://www.aliyundoc.com/xxx.mp4 |
of the object to be detectedURL.
|
Examples (Manual review)
Sample request
http(s)://[Endpoint]/green/video/manual/asyncScan
&<Common request parameters>
{
"seed": "seedxxx",
"callback": "http://www.aliyundoc.com",
"tasks": [{
"dataId": "dataIdxxxx",
"url": "http://www.aliyundoc.com/xxx.mp4"
}]
}
Sample success response
{
"code": 200,
"data": [{
"code": 200,
"dataId": "dataIdxxx",
"msg": "OK",
"taskId": "vi3tGoJ2zb45O5dQ7GAg1c32-1tyzXJ",
"url": "http://www.aliyundoc.com/xxx.mp4"
}],
"msg": "OK",
"requestId": "6CB46796-65F0-4CB1-9C7A-D64CC3108436"
}
Instructions for querying manual video review results
Operation: /green/video/manual/scan/results. Use this operation to query the results of a manual video review.
QPS limits
You can call this operation up to 50 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.
Request parameters (Result query)
|
Name |
Type |
Required |
Example |
Description |
|
body |
StringArray |
Yes |
["vi3tGoJ2zb45O5dQ7GAg1c32-1tyzXJ"] |
The list of IDs of asynchronous moderation tasks that you want to query. The array can contain up to 100 elements. After you submit a moderation task, you can obtain the ID of the task from the response. |
Response parameters (Result query)
|
Name |
Type |
Example |
Description |
|
code |
Integer |
200 |
The returned HTTP status code. For more information, see Common error codes. |
|
data |
JSONArray |
The data body that is returned for the request. Each element in the array represents the result of a manual video moderation task. For a detailed description of the structure of each element, see data. |
|
|
msg |
String |
OK |
The message returned for the request. |
|
requestId |
String |
96C587F7-1A3F-40C3-ABA0-C967E41A80E2 |
The request ID. |
|
Name |
Type |
Example |
Description |
|
code |
Integer |
200 |
The returned HTTP status code. For more information, see Common error codes. |
|
dataId |
String |
dataIdxxxx |
The ID of the moderation object. Note If you set the dataId parameter in the moderation request, the value of the dataId request parameter is returned here. |
|
msg |
String |
OK |
The message returned for the detection task. |
|
suggestion |
String |
pass |
The recommended subsequent operation. Valid values:
|
|
taskId |
String |
vi3tGoJ2zb45O5dQ7GAg1c32-1tyzXJ |
The task ID. |
|
url |
String |
http://www.aliyundoc.com/xxx.mp4 |
of the object to be detectedURL.
|
Examples (Result query)
Sample request
http(s)://[Endpoint]/green/video/manual/scan/results
&<Common request parameters>
[
"vi3tGoJ2zb45O5dQ7GAg1c32-1tyzXJ"
]
Sample success response
{
"code": 200,
"data": [{
"code": 200,
"dataId": "dataIdxxx",
"msg": "OK",
"suggestion": "pass",
"taskId": "vi3tGoJ2zb45O5dQ7GAg1c32-1tyzXJ",
"url": "http://www.aliyundoc.com/xxx.mp4"
}],
"msg": "OK",
"requestId": "96C587F7-1A3F-40C3-ABA0-C967E41A80E2"
}