tencent cloud

Cloud Infinite

Release Notes and Announcements
Release Notes
Announcements
Product Introduction
Product Overview
Product Strengths
Use Cases
Feature Overview
Regions and Domains
Specifications and Limits
Billing
Billing Overview
Billing Mode
Billable Items
Free Tier
Payment Overdue
Viewing Bill Details
FAQs
Getting Started
Registering and Logging In
Bind Bucket
Uploading and Processing File
Downloading and Deleting Images
Unbinding Buckets
Using CI via COS
Features
Image Processing
Media Processing
Content Moderation
AI Content Recognition
File Processing
Smart Voice
File processing
User Guide
Overview
Bucket Management
Smart Toolbox
Job and Workflow
Data Monitoring
Usage statistics
Use Cases
Copyright Protection Solutions
Image Processing Practices
Working with API Authorization Policies
Workflow Practices
API Documentation
API Overview
Structure
Common Request Headers
Common Response Headers
Activate Vast Service
Image Processing
AI-Based Content Recognition
Smart Audio
Media Processing
Content Moderation
Document Processing
File Processing
Job and Workflow
Cloud Virus Detection
Error Codes
Request Signature
SDK Documentation
SDK Overview
Android SDK
iOS SDK
COS Android SDK
C SDK
C++ SDK
.NET(C#) SDK
Go SDK
COS iOS SDK
Java SDK
JavaScript SDK
Node.js SDK
PHP SDK
Python SDK
Mini Program SDK
Personal Information Protection Policy for SDK
Security and Compliance
Permission ‍Management
FAQs
Basic Settings
Document Processing
Media Processing
Content Recognition
Smart Audio
Agreements
Service Level Agreement
Contact Us
Glossary

File Moderation

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 2024-03-01 15:15:09

Overview

This document describes how to use the content moderation feature provided by Cloud Infinite (CI). CI fully integrates the processing capabilities with the COS SDK.
Note:
To use the content moderation service, you need to have the permission to use CI:
For root accounts, click here for role authorization.
This document provides an overview of APIs and SDK code samples for file moderation.
Note:
The COS Mini Program SDK version should be or later than v1.1.1.
API
Description
Submits a file moderation job.
Queries the result of a specified file moderation job.

Submitting File Moderation Job

Feature description

This API is used to submit a file moderation job.

Sample request

var config = {
// Replace with your own bucket information
Bucket: 'examplebucket-1250000000', /* Bucket. Required */
Region: 'COS_REGION', /* Bucket region. Required */
};
function postDocumentAuditing() {
var host = config.Bucket + '.ci.' + config.Region + '.myqcloud.com';
var url = 'https://' + host + '/document/auditing';
var body = COS.util.json2xml({
Request: {
Input: {
Object: 'test.xlsx', /* Path of the file to be moderated in the bucket */
},
Conf: {
BizType: '',
DetectType: 'Porn',
}
}
});
cos.request({
Bucket: config.Bucket,
Region: config.Region,
Method: 'POST',
Url: url,
Key: '/document/auditing', /** Fixed value (required) */
ContentType: 'application/xml', /** Fixed value (required) */
Body: body
},
function(err, data){
console.log(err || data);
});
}

Parameter description

Request has the following sub-nodes:
Node Name (Keyword)
Parent Node
Description
Type
Required
Input
Request
Content to be moderated.
Container
Yes
Conf
Request
Moderation rule configuration.
Container
Yes
Input has the following sub-nodes:
Node Name (Keyword)
Parent Node
Description
Type
Required
Url
Request.Input
Full URL of the file, such as http://www.example.com/doctest.doc.
String
Yes
Type
Request.Input
File type. If this parameter is not specified, the file extension will be used as the type by default, such as DOC, DOCX, PPT, and PPTX.
If the file has no extension, this field must be specified; otherwise, moderation will fail.
String
No
Conf has the following sub-nodes:
Node Name (Keyword)
Parent Node
Description
Type
Required
DetectType
Request.Conf
The scene to be moderated, such as Porn (pornography) and Ads (advertising). You can pass in multiple types and separate them by comma, such as Porn,Ads.
String
No
Callback
Request.Conf
The moderation result can be sent to your callback address in the form of a callback. Addresses starting with http:// or https:// are supported, such as http://www.callback.com.
String
No
BizType
Request.Conf
Moderation policy. If this parameter is not specified, the default policy will be used. The policy can be configured in the console. For more information, see Setting Moderation Policy.
String
No

Response description

For more information, see Submitting File Moderation Job.

Querying File Moderation Job

Feature description

This API is used to query the status and result of a file moderation job.

Sample request

var config = {
// Replace with your own bucket information
Bucket: 'examplebucket-1250000000', /* Bucket. Required */
Region: 'COS_REGION', /* Bucket region. Required */
};
function getDocumentAuditingResult() {
var jobId = 'sd7815c21caff611eca12f525400d88xxx'; // `jobId`, which is returned after a file moderation job is submitted.
var host = config.Bucket + '.ci.' + config.Region + '.myqcloud.com';
var url = 'https://' + host + '/document/auditing/' + jobId;
cos.request({
Bucket: config.Bucket,
Region: config.Region,
Method: 'GET',
Key: '/document/auditing/' + jobId,
Url: url,
},
function(err, data){
console.log(err || data);
});
}

Parameter description

Parameter
Description
Type
Required
jobId
ID of the job to be queried.
String
Yes

Response description

For more information, see Querying File Moderation Job Result.


도움말 및 지원

문제 해결에 도움이 되었나요?

피드백