Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Content Moderation/ API Reference/ APIs/ Video Moderation/ Querying a Video Moderation Job

Querying a Video Moderation Job

Updated on 2024-11-04 GMT+08:00

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

NOTE:

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

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback