API | Description |
Submits webpage moderation job. | |
Queries the result of specified webpage moderation job. |
CosResult CosAPI::CreateWebPageAuditingJob(const CreateWebPageAuditingJobReq& req, CreateWebPageAuditingJobResp* resp);
qcloud_cos::CosConfig config("./config.json");qcloud_cos::CosAPI cos(config);std::string bucket_name = "examplebucket-1250000000";std::string url = "http://test.com";CreateWebPageAuditingJobReq req(bucket_name);CreateWebPageAuditingJobResp resp;// Add request parameters as detailed in the API documentationreq.SetUrl(url);req.SetDetectType("Porn,Ads");// Call the API to get the job response objectCosResult result = cos.CreateWebPageAuditingJob(req, &resp);if (result.IsSucc()) {// If the moderation job is created successfully, you can call the member functions of `CreateWebPageAuditingJobResp`.} else {// If the moderation job failed to be created, you can call the member functions of `CosResult` to output the error message.}
Parameter | Description | Type | Required |
req | CreateWebPageAuditing operation request | CreateWebPageAuditingJobReq | Yes |
resp | CreateWebPageAuditing operation response | CreateWebPageAuditingJobResp | Yes |
CreateWebPageAuditingJobReq
provides the following member functions:// Set the bucket for performing the operationvoid SetBucketName(const std::string& bucket_name);// Set the input video to be moderatedvoid SetInput(const AuditingInput& input);// Set moderation configuration rulesvoid SetConf(const Conf& conf);// 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`.void SetDetectType(const std::string& detect_type);// Callback address, which must start with `http://` or `https://`.void SetCallBack(const std::string& callback);// Specify whether to highlight the non-compliant text on the webpage. When the result is queried or called back, this parameter decides whether to return the highlighted HTML content. Valid values: `true`, `false`. Default value: `false`.void SetReturnHighligthHtml(const bool return_highlight_html);// input// Full URL of the webpage, such as `http://www.test.com`.void SetUrl(const std::string& url);// This field will return the original content in the moderation result, which can contain up to 512 bytes. You can use this field to uniquely identify the data to be moderated in your business.void SetDataId(const std::string& data_id);// Business field.void SetUserInfo(const UserInfo& user_info);
CreateWebPageAuditingJobResp
provides the following member functions:// Get the job details returned by the API requestWebPageAuditingJobsDetail GetJobsDetail();// Get the `RequestId` returned by the APIstd::string GetRequestId();
WebPageAuditingJobsDetail
structure. For specific response parameters, see Submitting Webpage Moderation Job.CosResult
structure. For more information, see Troubleshooting.CosResult DescribeWebPageAuditingJob(const DescribeWebPageAuditingJobReq& req, DescribeWebPageAuditingJobResp* resp);
qcloud_cos::CosConfig config("./config.json");qcloud_cos::CosAPI cos(config);std::string bucket_name = "examplebucket-1250000000";DescribeWebPageAuditingJobReq req(bucket_name);DescribeWebPageAuditingJobResp resp;// Add request parameters as detailed in the API documentationreq.SetJobId("aab1ca9fc8a3ed11ea834c525400863904");// Call the API to get the job response objectCosResult result = cos.DescribeWebPageAuditingJob(req, &resp);if (result.IsSucc()) {// If the moderation job is queried successfully, you can call the member functions of `DescribeWebPageAuditingJobResp`.} else {// If the moderation job failed to be queried, you can call the member functions of `CosResult` to output the error message.}
Parameter | Description | Type | Required |
req | DescribeWebPageAuditingJob operation request | DescribeWebPageAuditingJobReq | Yes |
resp | DescribeWebPageAuditingJob operation response | DescribeWebPageAuditingJobResp | Yes |
DescribeWebPageAuditingJobReq
provides the following member functions:// Set the bucket for performing the operationvoid SetBucketName(const std::string& bucket_name);// Set the ID of the moderation job to be queriedvoid SetJobId(const std::string& job_id);
DescribeWebPageAuditingJobResp
provides the following member functions:// Get the job details returned by the API requestWebPageAuditingJobsDetail GetJobsDetail();// Get the `RequestId` returned by the APIstd::string GetRequestId();
WebPageAuditingJobsDetail
structure. For specific response parameters, see Querying Webpage Moderation Job Result.CosResult
structure. For more information, see Troubleshooting.
Apakah halaman ini membantu?