Querying a Video Moderation Job
Function
This API is used to query the status and result of a video moderation job.
URI
GET /v3/{project_id}/moderation/video/jobs/{job_id}
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
job_id |
Yes |
String |
Job ID returned when a job is created |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token which can be obtained by calling the IAM API (The token is the value of X-Subject-Token in the response header.) |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
request_id |
String |
Unique ID of the request, which is used for troubleshooting. You are advised to save the ID. |
job_id |
String |
Job ID |
status |
String |
Job status. The options are as follows:
|
request_params |
request_params object |
Parameters for creating the job |
create_time |
String |
Time when the job was created |
update_time |
String |
Time when the job was updated |
result |
result object |
Job review result. This parameter is available when the job status is succeeded. |
Parameter |
Type |
Description |
---|---|---|
data |
data object |
Parameter data for creating the job |
event_type |
String |
Parameter event_type for creating the job |
image_categories |
Array of strings |
Parameter image_categories for creating the job |
audio_categories |
Array of strings |
Parameter audio_categories for creating the job |
callback |
String |
Parameter callback for creating the job |
Parameter |
Type |
Description |
---|---|---|
url |
String |
Parameter url for creating the job |
frame_interval |
Integer |
Parameter frame_interval for creating the job. By default, a frame is captured every 5s. |
Parameter |
Type |
Description |
---|---|---|
suggestion |
String |
Whether the video passes the check.
|
image_detail |
Array of image_detail objects |
Image moderation details |
audio_detail |
Array of audio_detail objects |
Audio moderation details |
Parameter |
Type |
Description |
---|---|---|
suggestion |
String |
Whether the image passes the check
|
category |
String |
Level-1 label of the detection result. The following categories are supported:
|
ocr_text |
String |
Detected text. This field is available only when category is set to image_text and text is detected. |
time |
Float |
Duration of the frame in the video file, in seconds |
detail |
Array of detail objects |
Image frame moderation details |
Parameter |
Type |
Description |
---|---|---|
confidence |
Float |
Confidence. The value ranges from 0 to 1. A larger value indicates a higher confidence. |
category |
String |
Level-1 label of the detection result. The following categories are supported:
|
suggestion |
String |
Whether the image frame passes the check
|
label |
String |
Detected label |
face_location |
face_location object |
Face location |
qr_location |
qr_location object |
QR code location |
qr_content |
String |
Link to the QR code in the image. This parameter is available when request parameter categories contains image_text. |
segments |
Array of segments objects |
Hit text segments in the image_text scenario |
Parameter |
Type |
Description |
---|---|---|
top_left_x |
Integer |
Horizontal coordinate of the upper left corner of detected face |
top_left_y |
Integer |
Vertical coordinate of the upper left corner of detected face |
bottom_right_x |
Integer |
Horizontal coordinate of the lower right corner of detected face |
bottom_right_y |
Integer |
Vertical coordinate of the lower right corner of detected face |
Parameter |
Type |
Description |
---|---|---|
top_left_x |
Integer |
Horizontal coordinate of the upper left corner of the detected QR code |
top_left_y |
Integer |
Vertical coordinate of the upper left corner of the detected QR code |
bottom_right_x |
Integer |
Horizontal coordinate of the lower right corner of the detected QR code |
bottom_right_y |
Integer |
Vertical coordinate of the lower right corner of the detected QR code |
Parameter |
Type |
Description |
---|---|---|
suggestion |
String |
Whether the audio clip passes the check
|
label |
String |
Audio clip detection label. Use the label with the highest confidence in detail. The options are as follows:
|
audio_text |
String |
Text of the audio clip |
end_time |
Float |
End time of the audio clip |
start_time |
Float |
Start time of the audio clip |
detail |
Array of detail objects |
Audio clip moderation details |
Parameter |
Type |
Description |
---|---|---|
confidence |
Float |
Confidence |
label |
String |
Label |
suggestion |
String |
Handling suggestion
|
segments |
Array of segments objects |
List of hit risk segments. This field is unavailable if semantic algorithm models are hit. |
Parameter |
Type |
Description |
---|---|---|
segment |
String |
Hit risk segment |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code of a failed API call. For details, see Error Codes. This parameter is not included when the API is successfully called. |
error_msg |
String |
Error message of a failed API call. This parameter is not included when the API is successfully called. |
Example Request
endpoint is the request URL for calling an API. Endpoints vary depending on services and regions. For details, see Endpoints.
GET https://{endpoint}/v3/{project_id}/moderation/video/jobs/{job_id}
Example Response
Status code: 200
Example of a successful response
{ "request_id" : "xxxx", "job_id" : "xxx", "status" : "succeeded", "request_params" : { "data" : { "url" : "xxxx", "frame_interval" : 5 }, "event_type" : "default", "image_categories" : [ "porn", "terrorism", "image_text" ], "audio_categories" : [ "porn", "ad", "moan", "abuse" ], "callback" : "xxx" }, "create_time" : "2022-07-30T08:57:11.011Z", "update_time" : "2022-07-30T08:57:14.014Z", "result" : { "suggestion" : "block", "image_detail" : [ { "suggestion" : "block", "category" : "porn", "ocr_text" : "123", "time" : 0, "detail" : [ { "confidence" : 0.676015138626099, "category" : "porn", "suggestion" : "block", "label" : "pornography" }, { "confidence" : 0.666015138626099, "category" : "porn", "suggestion" : "review", "label" : "sexy_female" }, { "confidence" : 0.666015138626099, "category" : "xxx", "suggestion" : "block", "label" : "leader" }, { "confidence" : 0.691423773765564, "category" : "xxx", "suggestion" : "block", "face_location" : { "top_left_x" : 12, "top_left_y" : 13, "bottom_right_x" : 200, "bottom_right_y" : 240 }, "label" : "leader" }, { "confidence" : 0.691423773765564, "category" : "porn", "suggestion" : "block", "face_location" : { "top_left_x" : 12, "top_left_y" : 13, "bottom_right_x" : 100, "bottom_right_y" : 2000 }, "label" : "leader" }, { "confidence" : 0.891423773765564, "category" : "image_text", "suggestion" : "block", "label" : "qr_code" }, { "confidence" : 0.891423773765564, "category" : "image_text", "suggestion" : "block", "label" : "qr_code", "qr_content" : "xxxxxxxxx", "qr_location" : { "top_left_x" : 12, "top_left_y" : 13, "bottom_right_x" : 100, "bottom_right_y" : 2000 } }, { "confidence" : 0.891423773765564, "category" : "image_text", "suggestion" : "block", "label" : "porn", "segments" : [ { "segment" : "xxx" }, { "segment" : "xx" } ] } ] } ], "audio_detail" : [ { "suggestion" : "block", "label" : "porn", "audio_text" : "xxxxx", "end_time" : 10, "start_time" : 0, "detail" : [ { "confidence" : 0.999117187582349, "label" : "porn", "suggestion" : "block", "segments" : [ { "segment" : "xxx" } ] }, { "confidence" : 0.885117187582349, "label" : "porn", "suggestion" : "block" } ] } ] } }
Status code: 400
Example of a failed response
{ "error_code" : "AIS.0030", "error_msg" : "Job not found" }
Status Codes
Status Code |
Description |
---|---|
200 |
Job status and result returned when the query is successful |
400 |
Error cause returned when the query fails |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot