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.

/**
 * Method for submitting an automated review job
 */
function submitAIMediaAuditJob($client) {
    $request = new vod\SubmitAIMediaAuditJobRequest();
    // Sets the video ID.
    $request->setMediaId("dc063078c1d845139e2a5bd8fxxxxxx");

    // Obtains a response.
    return $client->getAcsResponse($request);
}

/**
 * Call example
 */
try {
    $client = initVodClient("<AccessKeyId>", "<AccessKeySecret>"); 

    $result = submitAIMediaAuditJob($client);
    var_dump($result);
} catch (Exception $e) {
    print $e->getMessage()."\n"; 
}

Query an automated review job

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

/**
 * Method for querying an automated review job
 */
function getAIMediaAuditJob($client) {
    $request = new vod\GetAIMediaAuditJobRequest();
    // Sets the job ID.
    $request->setJobId("f980db7d82e644478206a4a521xxxxxx");

    // Obtains a response.
    return $client->getAcsResponse($request);
}

/**
 * Call example
 */
try {
    $client = initVodClient("<AccessKeyId>", "<AccessKeySecret>"); 

    $result = getAIMediaAuditJob($client);
    var_dump($result);
} catch (Exception $e) {
    print $e->getMessage()."\n"; 
}

Obtain the summary of the automated review result

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

/**
 * Method for obtaining the summary of the automated review result
 */
function getMediaAuditResult($client) {
    $request = new vod\GetMediaAuditResultRequest();
    // Sets the video ID.
    $request->setMediaId("dc063078c1d845139e2a5bd8ffxxxxxx");

    // Obtains a response.
    return $client->getAcsResponse($request);
}

/**
 * Call example
 */
try {
    $client = initVodClient("<AccessKeyId>", "<AccessKeySecret>"); 

    $result = getMediaAuditResult($client);
    var_dump($result);
} catch (Exception $e) {
    print $e->getMessage()."\n"; 
}

Obtain the details about the automated review result

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

/**
 * Method for obtaining the details about the automated review result
 */
function getMediaAuditResultDetail($client) {
    $request = new vod\GetMediaAuditResultDetailRequest();
    // Sets the video ID.
    $request->setMediaId("dc063078c1d845139e2a5bd8ffxxxxxx");
    // Sets the page number.
    $request->setPageNo(1);

    // Obtains a response.
    return $client->getAcsResponse($request);
}

/**
 * Call example
 */
try {
    $client = initVodClient("<AccessKeyId>", "<AccessKeySecret>"); 

    $result = getMediaAuditResultDetail($client);
    var_dump($result);
} catch (Exception $e) {
    print $e->getMessage()."\n"; 
}

Obtain the timeline of the automated review result

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

/**
 * Method for obtaining the timeline of the automated review result
 */
function getMediaAuditResultTimeline($client) {
    $request = new vod\GetMediaAuditResultTimelineRequest();
    // Sets the video ID.
    $request->setMediaId("dc063078c1d845139e2a5bd8ffxxxxxx");

    // Obtains a response.
    return $client->getAcsResponse($request);
}

/**
 * Call example
 */
try {
    $client = initVodClient("<AccessKeyId>", "<AccessKeySecret>"); 

    $result = getMediaAuditResultTimeline($client);
    var_dump($result);
} catch (Exception $e) {
    print $e->getMessage()."\n";
}

Start a manual review

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

/**
 * Method for constructing the manual review content
 */
function buildAuditContent() {
    $auditContent = array();

    $auditContent1 = array();
    $auditContent1["VideoId"] = "070bbc13d8294e35b36c3e7ab4xxxxxx"; // Sets the video ID.
    $auditContent1["Status"] = "Blocked"; // Sets the review status.
    $auditContent1["Reason"] = "Reason"; // Specifies the reason for blocking the video if the Status parameter is set to Blocked. Length constraint: maximum length of 128 bytes.
    $auditContent[] = $auditContent1;

    return json_encode($auditContent);
}

/**
 * Method for starting a manual review
 */
function createAudit($client) {
    $request = new vod\CreateAuditRequest();
    // Sets the manual review content.
    $request->setAuditContent(buildAuditContent());

    return $client->getAcsResponse($request);
}

/**
 * Call example
 */
try {
    $client = initVodClient("<AccessKeyId>", "<AccessKeySecret>"); 

    $result = createAudit($client);
    var_dump($result);
} catch (Exception $e) {
    print $e->getMessage()."\n"; 
}

Obtain the manual review history

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

/**
 * Method for obtaining the manual review history
 */
function getAuditHistory($client) {
    $request = new vod\GetAuditHistoryRequest();
    // Sets the video ID.
    $request->setVideoId("070bbc13d8294e35b36c3e7ab4xxxxxx");
    // Sets the page number.
    $request->setPageNo("1");
    // Sets the number of data records per page.
    $request->setPageSize("10");

    return $client->getAcsResponse($request);
}

/**
 * Call example
 */
try {
    $client = initVodClient("<AccessKeyId>", "<AccessKeySecret>");

    $result = getAuditHistory($client);
    var_dump($result);
} catch (Exception $e) {
    print $e->getMessage()."\n"; 
}

Add IP addresses to review security groups

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

/**
 * Method for adding IP addresses to review security groups
 */
function setAuditSecurityIp($client) {
    $request = new vod\SetAuditSecurityIpRequest();
    /// Sets the name of each review security group. Default value: Default.
    $request->setSecurityGroupName("MyGroupName");
    // Sets the write mode. The default value Append indicates that new IP addresses are appended to the whitelist.
    $request->setOperateMode("Cover");
    // Sets the whitelist of IP addresses in each review security group. Separate multiple IP addresses with a comma (,).
    $request->setIps("10.23.12.20,10.23.12.21,10.23.12.22");

    return $client->getAcsResponse($request);
}

/**
 * Call example
 */
try {
    $client = initVodClient("<AccessKeyId>", "<AccessKeySecret>");

    $result = setAuditSecurityIp($client);
    var_dump($result);
} catch (Exception $e) {
    print $e->getMessage()."\n"; 
}

Obtain a whitelist of IP addresses in review security groups

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

/**
 * Method for obtaining a whitelist of IP addresses in review security groups
 */
function listAuditSecurityIp($client) {
    $request = new vod\ListAuditSecurityIpRequest();
    /// Sets the name of each review security group. Default value: Default.
    $request->setSecurityGroupName("MyGroupName");

    return $client->getAcsResponse($request);
}

/**
 * Call example
 */
try {
    $client = initVodClient("<AccessKeyId>", "<AccessKeySecret>"); 

    $result = listAuditSecurityIp($client);
    var_dump($result);
} catch (Exception $e) {
    print $e->getMessage()."\n"; 
}