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

Result Query

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

Function

This API queries the result of a batch image moderation job. If the batch job is executed successfully, the detailed moderation result of each image is returned. The batch job will not fail upon the failure of a single image.

NOTE:

The jobs will be stored on the cloud for a maximum of 30 minutes. You are advised to perform a periodic query every 30 seconds after the batch job is submitted.

URI

GET /v2/{project_id}/moderation/image/batch

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.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

job_id

Yes

String

Indicates the job ID.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Indicates the user token.

Used to obtain the permission to operate APIs. For details about how to obtain the token, see Authentication. The value of X-Subject-Token in the response header is the token.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

result

CheckResultResultBody object

Indicates the calling result of a successful API call.

This parameter is not included when the API fails to be called.

Table 5 CheckResultResultBody parameters

Parameter

Type

Description

job_id

String

Indicates the job ID.

status

String

Indicates the job status. Possible values are as follows:

  • created: indicates that a job is created.
  • running: indicates that a job is being processed.
  • finish: indicates that a job is completed.
  • failed: indicates that a job fails to be processed.

create_time

String

Indicates the time when a job is created, for example, 2018-01-02T15:03:04Z.

update_time

String

Indicates the time when a job is updated, for example, 2018-01-02T15:03:04Z.

items

Array of CheckResultItemsBody objects

Indicates the list of image moderation results.

Table 6 CheckResultItemsBody parameters

Parameter

Type

Description

url

String

Indicates the URL of an image.

suggestion

String

Indicates whether the images pass the check.

  • block: The images contain sensitive information and fail to pass the check.
  • pass: indicates that no sensitive information is detected and the information passes the check.
  • review: The images need to be manually reviewed.
NOTE:
  1. When multiple scenarios are detected at the same time, the value of suggestion is subject to the scenario where sensitive information is most likely to be contained. That is, if a block occurs in any scenario, the value of suggestion is block. If all scenarios pass the check, the value of suggestion is pass. In addition, if manual review is required in any scenario, the value of suggestion is review.
  2. This service does not save your API call results (such as historical block information). You are advised to retain the logs of API call results.

detail

ImageDetectionResultDetail object

Indicates a list of detection results of a specific scenario. porn lists the detection results of pornographic elements. If the maximum confidence score of a specific detection scenario is smaller than the value of threshold, the list of detection results is empty.

category_suggestions

Map<String,String>

Indicates the check result of each scenario. Possible values are as follows:

  • block: indicates that sensitive information is detected and the information fails to pass the check.
  • pass: indicates that no sensitive information is detected and the information passes the check.
  • review: indicates that the image needs to be manually reviewed.

ocr_text

String

OCR recognition result

Table 7 ImageDetectionResultDetail parameters

Parameter

Type

Description

porn

Array of ImageDetectionResultSimpleDetail objects

Indicates that pornographic content was detected.

Table 8 ImageDetectionResultSimpleDetail parameters

Parameter

Type

Description

confidence

Float

Indicates the confidence score. The value ranges from 0 to 1.

label

String

Indicates the label of each detection result. The options are as follows:

porn: The image contains porn information. label classifies pornographic elements (porn information or sexy information).

  • The porn scenario supports the following labels:
    • normal: The image does not contain pornographic elements.
    • porn: The image contains pornographic elements.
    • sexy: The image contains suggestive content.

Status code: 400

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Indicates the 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

Indicates the error message of a failed API call.

This parameter is not included when the API is successfully called.

fail_category

String

Indicates the API calling failure scenario when there are multiple scenarios.

Example Requests

NOTE:

endpoint is the request URL for calling an API. Endpoints vary depending on services and regions. For details, see Endpoints.

For example, the endpoint of the service deployed in the CN-Hong Kong region is moderation.ap-southeast-1.myhuaweicloud.com, the request URL is https://moderation.ap-southeast-1.myhuaweicloud.com/v2/{project_id}/moderation/image/batch?job_id={job_id}, project_id is the project ID, and job_id is the job ID returned by the API. For details, see Obtaining a Project ID.

GET https://{endpoint}/v2/{project_id}/moderation/image/batch?job_id={job_id}

Example Responses

Status code: 200

Example of a successful response

{
  "result" : {
    "job_id" : "44d93b70-db01-4f96-a618-2a79c964c4b2",
    "status" : "finish",
    "create_time" : "2018-01-02T15:03:04Z",
    "update_time" : "2018-01-02T15:03:04Z",
    "items" : [ {
      "url" : "https://obs-test-llg.obs.myhuaweicloud.com/terrorism",
      "suggestion" : "pass",
      "detail" : {
      }
    }, {
      "url" : "https://obs-test-llg.obs.myhuaweicloud.com/clarity-detect",
      "suggestion" : "pass",
      "detail" : {
      },
      "ocr_text" : "fdfefdfdfdfd"
    } ]
  }
}

Status code: 400

Example of a failed response

{
  "error_code" : "AIS.0005",
  "error_msg" : "The service does not exist."
}

Status Codes

Status Code

Description

200

Example of a successful response

400

Example of a failed response

Error Codes

For details, see Error Codes.

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