All Products
Search
Document Center

Media content moderation

Last Updated: Jul 11, 2019

Initialize a client

Initialize a client before using the SDK. For more information, see initVodClient.

Submit an automated review job

For more information about the request and response parameters, see SubmitAIMediaAuditJob.

#include <stdio.h>
#include <string>
#include <map>
#include "vod_sdk/openApiUtil.h"

/**
 * Method for submitting an automated review job
 */
VodApiResponse submitAIMediaAuditJob(VodCredential authInfo) {
    string apiName = "SubmitAIMediaAuditJob";
    map<string, string> args; 
    // Sets the video ID.
    args["MediaId"] = "dc063078c1d845139e2a5bd8ffxxxxxx";
    return getAcsResponse(authInfo, apiName, args);
}

// Call example
void main() {
    VodCredential authInfo = initVodClient("<Your AccessKey ID>", "<Your AccessKey Secret>");
    VodApiResponse response = submitAIMediaAuditJob(authInfo);
    printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
}

Query an automated review job

For more information about the request and response parameters, see GetAIMediaAuditJob.

#include <stdio.h>
#include <string>
#include <map>
#include "vod_sdk/openApiUtil.h"

/**
 * Method for querying an automated review job
 */
VodApiResponse getAIMediaAuditJob(VodCredential authInfo) {
    string apiName = "GetAIMediaAuditJob";
    map<string, string> args;
    // Sets the job ID.
    args["JobId"] = "7dc69b893c8b4f13b47aae8de0xxxxxx";
    return getAcsResponse(authInfo, apiName, args);
}

// Call example
void main() {
    VodCredential authInfo = initVodClient("<Your AccessKey ID>", "<Your AccessKey Secret>");
    VodApiResponse response = getAIMediaAuditJob(authInfo);
    printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
}

Obtain the summary of the automated review result

For more information about the request and response parameters, see GetMediaAuditResult.

#include <stdio.h>
#include <string>
#include <map>
#include "vod_sdk/openApiUtil.h"

/**
 * Method for obtaining the summary of the automated review result
 */
VodApiResponse getMediaAuditResult(VodCredential authInfo) {
    string apiName = "GetMediaAuditResult";
    map<string, string> args;
    // Sets the video ID.
    args["MediaId"] = "dc063078c1d845139e2a5bd8fxxxxxx";
    return getAcsResponse(authInfo, apiName, args);
}

// Call example
void main() {
    VodCredential authInfo = initVodClient("<Your AccessKey ID>", "<Your AccessKey Secret>");
    VodApiResponse response = getMediaAuditResult(authInfo);
    printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
}

Obtain the details about the automated review result

For more information about the request and response parameters, see GetMediaAuditResultDetail.

#include <stdio.h>
#include <string>
#include <map>
#include "vod_sdk/openApiUtil.h"

/**
 * Method for obtaining the details about the automated review result
 */
VodApiResponse getMediaAuditResultDetail(VodCredential authInfo) {
    string apiName = "GetMediaAuditResultDetail";
    map<string, string> args;
    // Sets the video ID.
    args["MediaId"] = "dc063078c1d845139e2a5bd8fxxxxxx";
    // Sets the page number.
    args["PageNo"] = "1";
    return getAcsResponse(authInfo, apiName, args);
}

// Call example
void main() {
    VodCredential authInfo = initVodClient("<Your AccessKey ID>", "<Your AccessKey Secret>");
    VodApiResponse response = getMediaAuditResultDetail(authInfo);
    printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
}

Obtain the timeline of the automated review result

For more information about the request and response parameters, see GetMediaAuditResultTimeline.

#include <stdio.h>
#include <string>
#include <map>
#include "vod_sdk/openApiUtil.h"

/**
 * Method for obtaining the timeline of the automated review result
 */
VodApiResponse getMediaAuditResultTimeline(VodCredential authInfo) {
    string apiName = "GetMediaAuditResultTimeline";
    map<string, string> args; 
    // Sets the video ID.
    args["MediaId"] = "dc063078c1d845139e2a5bd8fxxxxxx";
    return getAcsResponse(authInfo, apiName, args);
}

// Call example
void main() {
    VodCredential authInfo = initVodClient("<Your AccessKey ID>", "<Your AccessKey Secret>");
    VodApiResponse response = getMediaAuditResultTimeline(authInfo);
    printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
}

Start a manual review

For more information about the request and response parameters, see CreateAudit.

#include <stdio.h>
#include <string>
#include <map>
#include <jsoncpp/json/json.h> 
#include "vod_sdk/openApiUtil.h"

/**
 * Method for constructing the manual review content
 */
Json::Value buildAuditContent() {
        Json::Value auditContents;
        Json::Value auditContent;
        auditContent["VideoId"] = "3ebc10160bda481ca9b6858a0bxxxxxx"; // Sets the video ID.
        auditContent["Status"] = "Blocked"; // Sets the review status.
        auditContent["Reason"] = "porn video"; // Specifies the reason for blocking the video if the Status parameter is set to Blocked. Length constraint: maximum length of 128 bytes.
        auditContents.append(auditContent);
        return auditContents;
}

/**
 * Method for starting a manual review
 */
VodApiResponse createAudit(VodCredential authInfo) {
    string apiName = "CreateAudit";
    map<string, string> args;
    // Sets the manual review content.
    args["AuditContent"] = buildAuditContent().toStyledString();
    return getAcsResponse(authInfo, apiName, args);
}

// Call example
void main() {
    VodCredential authInfo = initVodClient("<Your AccessKey ID>", "<Your AccessKey Secret>");
    VodApiResponse response = createAudit(authInfo);
    printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
}

Obtain the manual review history

For more information about the request and response parameters, see GetAuditHistory.

#include <stdio.h>
#include <string>
#include <map>
#include <jsoncpp/json/json.h> 
#include "vod_sdk/openApiUtil.h"

/**
 * Method for obtaining the manual review history
 */
VodApiResponse getAuditHistory(VodCredential authInfo) {
    string apiName = "GetAuditHistory";
    map<string, string> args;
    // Sets the video ID.
    args["VideoId"] = "3ebc10160bda481ca9b6858a0bxxxxxx";
    // Sets the page number.
    args["PageNo"] = "1";
    // Sets the number of data records per page.
    args["PageSize"] = "10";
    return getAcsResponse(authInfo, apiName, args);
}

// Call example
void main() {
    VodCredential authInfo = initVodClient("<Your AccessKey ID>", "<Your AccessKey Secret>");
    VodApiResponse response = getAuditHistory(authInfo);
    printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
}

Add IP addresses to review security groups

For more information about the request and response parameters, see SetAuditSecurityIp.

#include <stdio.h>
#include <string>
#include <map>
#include <jsoncpp/json/json.h> 
#include "vod_sdk/openApiUtil.h"

/**
 * Method for adding IP addresses to review security groups
 */
VodApiResponse setAuditSecurityIp(VodCredential authInfo) {
    string apiName = "SetAuditSecurityIp";
    map<string, string> args;
    // Sets the name of each review security group. Default value: Default.
    args["SecurityGroupName"] = "MyGroupName";
    // Sets the write mode. The default value Append indicates that new IP addresses are appended to the whitelist.
    args["OperateMode"] = "Cover";
    // Sets the whitelist of IP addresses in each review security group.
    args["Ips"] = "10.23.12.20,10.23.12.21,10.23.12.22";
    return getAcsResponse(authInfo, apiName, args);
}

// Call example
void main() {
    VodCredential authInfo = initVodClient("<Your AccessKey ID>", "<Your AccessKey Secret>");
    VodApiResponse response = setAuditSecurityIp(authInfo);
    printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
}

Obtain a whitelist of IP addresses in review security groups

For more information about the request and response parameters, see ListAuditSecurityIp.

#include <stdio.h>
#include <string>
#include <map>
#include <jsoncpp/json/json.h> 
#include "vod_sdk/openApiUtil.h"

/**
 * Method for obtaining a whitelist of IP addresses in review security groups
 */
VodApiResponse listAuditSecurityIp(VodCredential authInfo) {
    string apiName = "ListAuditSecurityIp";
    map<string, string> args;
    // Sets the name of each review security group.
    args["SecurityGroupName"] = "MyGroupName";
    return getAcsResponse(authInfo, apiName, args);
}

// Call example
void main() {
    VodCredential authInfo = initVodClient("<Your AccessKey ID>", "<Your AccessKey Secret>");
    VodApiResponse response = listAuditSecurityIp(authInfo);
    printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
}