Help Center/ Content Moderation/ API Reference/ APIs/ Video Moderation/ Querying a Video Moderation Job
Updated on 2024-11-04 GMT+08:00

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}

Table 1 Path parameters

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

Table 2 Request header 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

Table 3 Response body parameters

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:

  • running: The job is running.
  • succeeded: The job was executed successfully.
  • failed: The job failed.

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.

Table 4 request_params

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

Table 5 data

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.

Table 6 result

Parameter

Type

Description

suggestion

String

Whether the video passes the check.

  • block: The video contains sensitive information and fails to pass the check.
  • review: The video needs to be manually reviewed.
  • pass: The video does not contain sensitive information and passes the check.

image_detail

Array of image_detail objects

Image moderation details

audio_detail

Array of audio_detail objects

Audio moderation details

Table 7 image_detail

Parameter

Type

Description

suggestion

String

Whether the image passes the check

  • block: The image contains sensitive information and fails to pass the check.
  • review: The image needs to be manually reviewed.

category

String

Level-1 label of the detection result. The following categories are supported:

  • terrorism: terrorism-related information
  • porn: pornographic information
  • image_text: image and text

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

Table 8 detail

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:

  • terrorism: terrorism-related information
  • porn: pornographic information
  • image_text: image and text

suggestion

String

Whether the image frame passes the check

  • block: The image frame contains sensitive information and fails to pass the check.
  • review: The image frame needs to be manually reviewed.

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

Table 9 face_location

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

Table 10 qr_location

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

Table 11 segments

Parameter

Type

Description

segment

String

Hit risk segment

Table 12 audio_detail

Parameter

Type

Description

suggestion

String

Whether the audio clip passes the check

  • block: The audio clip contains sensitive information and fails to pass the check.
  • review: The audio clip needs to be manually reviewed.

label

String

Audio clip detection label. Use the label with the highest confidence in detail. The options are as follows:

  • terrorism
  • porn
  • ad
  • ad_law
  • abuse
  • ban
  • meaningless
  • moan

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

Table 13 detail

Parameter

Type

Description

confidence

Float

Confidence

label

String

Label

suggestion

String

Handling suggestion

  • block: The audio clip contains sensitive information and fails to pass the check.
  • review: The audio clip needs to be manually reviewed.

segments

Array of segments objects

List of hit risk segments. This field is unavailable if semantic algorithm models are hit.

Table 14 segments

Parameter

Type

Description

segment

String

Hit risk segment

Status code: 400

Table 15 Response body parameters

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