All Products
Search
Document Center

Media content moderation

Last Updated: May 27, 2020

Initialize a client

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

Submit an automated review job

  1. /**
  2. * Method for submitting an automated review job
  3. */
  4. function submitAIMediaAuditJob($client) {
  5. $request = new vod\SubmitAIMediaAuditJobRequest();
  6. // Sets the video ID.
  7. $request->setMediaId("dc063078c1d845139e2a5bd8fxxxxxx");
  8. // Obtains a response.
  9. return $client->getAcsResponse($request);
  10. }
  11. /**
  12. * Call example
  13. */
  14. try {
  15. $client = initVodClient("<AccessKeyId>", "<AccessKeySecret>");
  16. $result = submitAIMediaAuditJob($client);
  17. var_dump($result);
  18. } catch (Exception $e) {
  19. print $e->getMessage()."\n";
  20. }

Query an automated review job

  1. /**
  2. * Method for querying an automated review job
  3. */
  4. function getAIMediaAuditJob($client) {
  5. $request = new vod\GetAIMediaAuditJobRequest();
  6. // Sets the job ID.
  7. $request->setJobId("f980db7d82e644478206a4a521xxxxxx");
  8. // Obtains a response.
  9. return $client->getAcsResponse($request);
  10. }
  11. /**
  12. * Call example
  13. */
  14. try {
  15. $client = initVodClient("<AccessKeyId>", "<AccessKeySecret>");
  16. $result = getAIMediaAuditJob($client);
  17. var_dump($result);
  18. } catch (Exception $e) {
  19. print $e->getMessage()."\n";
  20. }

Obtain the summary of the automated review result

  1. /**
  2. * Method for obtaining the summary of the automated review result
  3. */
  4. function getMediaAuditResult($client) {
  5. $request = new vod\GetMediaAuditResultRequest();
  6. // Sets the video ID.
  7. $request->setMediaId("dc063078c1d845139e2a5bd8ffxxxxxx");
  8. // Obtains a response.
  9. return $client->getAcsResponse($request);
  10. }
  11. /**
  12. * Call example
  13. */
  14. try {
  15. $client = initVodClient("<AccessKeyId>", "<AccessKeySecret>");
  16. $result = getMediaAuditResult($client);
  17. var_dump($result);
  18. } catch (Exception $e) {
  19. print $e->getMessage()."\n";
  20. }

Obtain the details about the automated review result

  1. /**
  2. * Method for obtaining the details about the automated review result
  3. */
  4. function getMediaAuditResultDetail($client) {
  5. $request = new vod\GetMediaAuditResultDetailRequest();
  6. // Sets the video ID.
  7. $request->setMediaId("dc063078c1d845139e2a5bd8ffxxxxxx");
  8. // Sets the page number.
  9. $request->setPageNo(1);
  10. // Obtains a response.
  11. return $client->getAcsResponse($request);
  12. }
  13. /**
  14. * Call example
  15. */
  16. try {
  17. $client = initVodClient("<AccessKeyId>", "<AccessKeySecret>");
  18. $result = getMediaAuditResultDetail($client);
  19. var_dump($result);
  20. } catch (Exception $e) {
  21. print $e->getMessage()."\n";
  22. }

Obtain the timeline of the automated review result

  1. /**
  2. * Method for obtaining the timeline of the automated review result
  3. */
  4. function getMediaAuditResultTimeline($client) {
  5. $request = new vod\GetMediaAuditResultTimelineRequest();
  6. // Sets the video ID.
  7. $request->setMediaId("dc063078c1d845139e2a5bd8ffxxxxxx");
  8. // Obtains a response.
  9. return $client->getAcsResponse($request);
  10. }
  11. /**
  12. * Call example
  13. */
  14. try {
  15. $client = initVodClient("<AccessKeyId>", "<AccessKeySecret>");
  16. $result = getMediaAuditResultTimeline($client);
  17. var_dump($result);
  18. } catch (Exception $e) {
  19. print $e->getMessage()."\n";
  20. }

Start a manual review

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

  1. /**
  2. * Method for constructing the manual review content
  3. */
  4. function buildAuditContent() {
  5. $auditContent = array();
  6. $auditContent1 = array();
  7. $auditContent1["VideoId"] = "070bbc13d8294e35b36c3e7ab4xxxxxx"; // Sets the video ID.
  8. $auditContent1["Status"] = "Blocked"; // Sets the review status.
  9. $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.
  10. $auditContent[] = $auditContent1;
  11. return json_encode($auditContent);
  12. }
  13. /**
  14. * Method for starting a manual review
  15. */
  16. function createAudit($client) {
  17. $request = new vod\CreateAuditRequest();
  18. // Sets the manual review content.
  19. $request->setAuditContent(buildAuditContent());
  20. return $client->getAcsResponse($request);
  21. }
  22. /**
  23. * Call example
  24. */
  25. try {
  26. $client = initVodClient("<AccessKeyId>", "<AccessKeySecret>");
  27. $result = createAudit($client);
  28. var_dump($result);
  29. } catch (Exception $e) {
  30. print $e->getMessage()."\n";
  31. }

Obtain the manual review history

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

  1. /**
  2. * Method for obtaining the manual review history
  3. */
  4. function getAuditHistory($client) {
  5. $request = new vod\GetAuditHistoryRequest();
  6. // Sets the video ID.
  7. $request->setVideoId("070bbc13d8294e35b36c3e7ab4xxxxxx");
  8. // Sets the page number.
  9. $request->setPageNo("1");
  10. // Sets the number of data records per page.
  11. $request->setPageSize("10");
  12. return $client->getAcsResponse($request);
  13. }
  14. /**
  15. * Call example
  16. */
  17. try {
  18. $client = initVodClient("<AccessKeyId>", "<AccessKeySecret>");
  19. $result = getAuditHistory($client);
  20. var_dump($result);
  21. } catch (Exception $e) {
  22. print $e->getMessage()."\n";
  23. }

Add IP addresses to review security groups

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

  1. /**
  2. * Method for adding IP addresses to review security groups
  3. */
  4. function setAuditSecurityIp($client) {
  5. $request = new vod\SetAuditSecurityIpRequest();
  6. /// Sets the name of each review security group. Default value: Default.
  7. $request->setSecurityGroupName("MyGroupName");
  8. // Sets the write mode. The default value Append indicates that new IP addresses are appended to the whitelist.
  9. $request->setOperateMode("Cover");
  10. // Sets the whitelist of IP addresses in each review security group. Separate multiple IP addresses with a comma (,).
  11. $request->setIps("10.23.12.20,10.23.12.21,10.23.12.22");
  12. return $client->getAcsResponse($request);
  13. }
  14. /**
  15. * Call example
  16. */
  17. try {
  18. $client = initVodClient("<AccessKeyId>", "<AccessKeySecret>");
  19. $result = setAuditSecurityIp($client);
  20. var_dump($result);
  21. } catch (Exception $e) {
  22. print $e->getMessage()."\n";
  23. }

Obtain a whitelist of IP addresses in review security groups

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

  1. /**
  2. * Method for obtaining a whitelist of IP addresses in review security groups
  3. */
  4. function listAuditSecurityIp($client) {
  5. $request = new vod\ListAuditSecurityIpRequest();
  6. /// Sets the name of each review security group. Default value: Default.
  7. $request->setSecurityGroupName("MyGroupName");
  8. return $client->getAcsResponse($request);
  9. }
  10. /**
  11. * Call example
  12. */
  13. try {
  14. $client = initVodClient("<AccessKeyId>", "<AccessKeySecret>");
  15. $result = listAuditSecurityIp($client);
  16. var_dump($result);
  17. } catch (Exception $e) {
  18. print $e->getMessage()."\n";
  19. }