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. #include <stdio.h>
  2. #include <string>
  3. #include <map>
  4. #include "vod_sdk/openApiUtil.h"
  5. /**
  6. * Method for submitting an automated review job
  7. */
  8. VodApiResponse submitAIMediaAuditJob(VodCredential authInfo) {
  9. string apiName = "SubmitAIMediaAuditJob";
  10. map<string, string> args;
  11. // Sets the video ID.
  12. args["MediaId"] = "dc063078c1d845139e2a5bd8ffxxxxxx";
  13. return getAcsResponse(authInfo, apiName, args);
  14. }
  15. // Call example
  16. void main() {
  17. VodCredential authInfo = initVodClient("<Your AccessKey ID>", "<Your AccessKey Secret>");
  18. VodApiResponse response = submitAIMediaAuditJob(authInfo);
  19. printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
  20. }

Query an automated review job

  1. #include <stdio.h>
  2. #include <string>
  3. #include <map>
  4. #include "vod_sdk/openApiUtil.h"
  5. /**
  6. * Method for querying an automated review job
  7. */
  8. VodApiResponse getAIMediaAuditJob(VodCredential authInfo) {
  9. string apiName = "GetAIMediaAuditJob";
  10. map<string, string> args;
  11. // Sets the job ID.
  12. args["JobId"] = "7dc69b893c8b4f13b47aae8de0xxxxxx";
  13. return getAcsResponse(authInfo, apiName, args);
  14. }
  15. // Call example
  16. void main() {
  17. VodCredential authInfo = initVodClient("<Your AccessKey ID>", "<Your AccessKey Secret>");
  18. VodApiResponse response = getAIMediaAuditJob(authInfo);
  19. printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
  20. }

Obtain the summary of the automated review result

  1. #include <stdio.h>
  2. #include <string>
  3. #include <map>
  4. #include "vod_sdk/openApiUtil.h"
  5. /**
  6. * Method for obtaining the summary of the automated review result
  7. */
  8. VodApiResponse getMediaAuditResult(VodCredential authInfo) {
  9. string apiName = "GetMediaAuditResult";
  10. map<string, string> args;
  11. // Sets the video ID.
  12. args["MediaId"] = "dc063078c1d845139e2a5bd8fxxxxxx";
  13. return getAcsResponse(authInfo, apiName, args);
  14. }
  15. // Call example
  16. void main() {
  17. VodCredential authInfo = initVodClient("<Your AccessKey ID>", "<Your AccessKey Secret>");
  18. VodApiResponse response = getMediaAuditResult(authInfo);
  19. printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
  20. }

Obtain the details about the automated review result

  1. #include <stdio.h>
  2. #include <string>
  3. #include <map>
  4. #include "vod_sdk/openApiUtil.h"
  5. /**
  6. * Method for obtaining the details about the automated review result
  7. */
  8. VodApiResponse getMediaAuditResultDetail(VodCredential authInfo) {
  9. string apiName = "GetMediaAuditResultDetail";
  10. map<string, string> args;
  11. // Sets the video ID.
  12. args["MediaId"] = "dc063078c1d845139e2a5bd8fxxxxxx";
  13. // Sets the page number.
  14. args["PageNo"] = "1";
  15. return getAcsResponse(authInfo, apiName, args);
  16. }
  17. // Call example
  18. void main() {
  19. VodCredential authInfo = initVodClient("<Your AccessKey ID>", "<Your AccessKey Secret>");
  20. VodApiResponse response = getMediaAuditResultDetail(authInfo);
  21. printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
  22. }

Obtain the timeline of the automated review result

  1. #include <stdio.h>
  2. #include <string>
  3. #include <map>
  4. #include "vod_sdk/openApiUtil.h"
  5. /**
  6. * Method for obtaining the timeline of the automated review result
  7. */
  8. VodApiResponse getMediaAuditResultTimeline(VodCredential authInfo) {
  9. string apiName = "GetMediaAuditResultTimeline";
  10. map<string, string> args;
  11. // Sets the video ID.
  12. args["MediaId"] = "dc063078c1d845139e2a5bd8fxxxxxx";
  13. return getAcsResponse(authInfo, apiName, args);
  14. }
  15. // Call example
  16. void main() {
  17. VodCredential authInfo = initVodClient("<Your AccessKey ID>", "<Your AccessKey Secret>");
  18. VodApiResponse response = getMediaAuditResultTimeline(authInfo);
  19. printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
  20. }

Start a manual review

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

  1. #include <stdio.h>
  2. #include <string>
  3. #include <map>
  4. #include <jsoncpp/json/json.h>
  5. #include "vod_sdk/openApiUtil.h"
  6. /**
  7. * Method for constructing the manual review content
  8. */
  9. Json::Value buildAuditContent() {
  10. Json::Value auditContents;
  11. Json::Value auditContent;
  12. auditContent["VideoId"] = "3ebc10160bda481ca9b6858a0bxxxxxx"; // Sets the video ID.
  13. auditContent["Status"] = "Blocked"; // Sets the review status.
  14. 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.
  15. auditContents.append(auditContent);
  16. return auditContents;
  17. }
  18. /**
  19. * Method for starting a manual review
  20. */
  21. VodApiResponse createAudit(VodCredential authInfo) {
  22. string apiName = "CreateAudit";
  23. map<string, string> args;
  24. // Sets the manual review content.
  25. args["AuditContent"] = buildAuditContent().toStyledString();
  26. return getAcsResponse(authInfo, apiName, args);
  27. }
  28. // Call example
  29. void main() {
  30. VodCredential authInfo = initVodClient("<Your AccessKey ID>", "<Your AccessKey Secret>");
  31. VodApiResponse response = createAudit(authInfo);
  32. printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
  33. }

Obtain the manual review history

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

  1. #include <stdio.h>
  2. #include <string>
  3. #include <map>
  4. #include <jsoncpp/json/json.h>
  5. #include "vod_sdk/openApiUtil.h"
  6. /**
  7. * Method for obtaining the manual review history
  8. */
  9. VodApiResponse getAuditHistory(VodCredential authInfo) {
  10. string apiName = "GetAuditHistory";
  11. map<string, string> args;
  12. // Sets the video ID.
  13. args["VideoId"] = "3ebc10160bda481ca9b6858a0bxxxxxx";
  14. // Sets the page number.
  15. args["PageNo"] = "1";
  16. // Sets the number of data records per page.
  17. args["PageSize"] = "10";
  18. return getAcsResponse(authInfo, apiName, args);
  19. }
  20. // Call example
  21. void main() {
  22. VodCredential authInfo = initVodClient("<Your AccessKey ID>", "<Your AccessKey Secret>");
  23. VodApiResponse response = getAuditHistory(authInfo);
  24. printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
  25. }

Add IP addresses to review security groups

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

  1. #include <stdio.h>
  2. #include <string>
  3. #include <map>
  4. #include <jsoncpp/json/json.h>
  5. #include "vod_sdk/openApiUtil.h"
  6. /**
  7. * Method for adding IP addresses to review security groups
  8. */
  9. VodApiResponse setAuditSecurityIp(VodCredential authInfo) {
  10. string apiName = "SetAuditSecurityIp";
  11. map<string, string> args;
  12. // Sets the name of each review security group. Default value: Default.
  13. args["SecurityGroupName"] = "MyGroupName";
  14. // Sets the write mode. The default value Append indicates that new IP addresses are appended to the whitelist.
  15. args["OperateMode"] = "Cover";
  16. // Sets the whitelist of IP addresses in each review security group.
  17. args["Ips"] = "10.23.12.20,10.23.12.21,10.23.12.22";
  18. return getAcsResponse(authInfo, apiName, args);
  19. }
  20. // Call example
  21. void main() {
  22. VodCredential authInfo = initVodClient("<Your AccessKey ID>", "<Your AccessKey Secret>");
  23. VodApiResponse response = setAuditSecurityIp(authInfo);
  24. printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
  25. }

Obtain a whitelist of IP addresses in review security groups

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

  1. #include <stdio.h>
  2. #include <string>
  3. #include <map>
  4. #include <jsoncpp/json/json.h>
  5. #include "vod_sdk/openApiUtil.h"
  6. /**
  7. * Method for obtaining a whitelist of IP addresses in review security groups
  8. */
  9. VodApiResponse listAuditSecurityIp(VodCredential authInfo) {
  10. string apiName = "ListAuditSecurityIp";
  11. map<string, string> args;
  12. // Sets the name of each review security group.
  13. args["SecurityGroupName"] = "MyGroupName";
  14. return getAcsResponse(authInfo, apiName, args);
  15. }
  16. // Call example
  17. void main() {
  18. VodCredential authInfo = initVodClient("<Your AccessKey ID>", "<Your AccessKey Secret>");
  19. VodApiResponse response = listAuditSecurityIp(authInfo);
  20. printf("httpCode: %d, result: %s\n", response.httpCode, response.result.c_str());
  21. }