我们正在更新 Data API,以便与 YouTube 统计 Shorts 短视频观看次数的方式保持一致。
了解详情
Videos: reportAbuse
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
举报视频包含滥用内容。
配额影响:对此方法的调用会产生 50 个单位的配额费用。
请求
HTTP 请求
POST https://www.googleapis.com/youtube/v3/videos/reportAbuse
授权
此请求需要获得以下至少一个范围的授权(详细了解身份验证和授权)。
范围 |
https://www.googleapis.com/auth/youtube |
https://www.googleapis.com/auth/youtube.force-ssl |
https://www.googleapis.com/auth/youtubepartner |
参数
下表列出了此查询支持的参数。列出的所有参数都是查询参数。
参数 |
可选参数 |
onBehalfOfContentOwner |
string
此参数只能在经过适当授权的请求中使用。注意:此参数仅供 YouTube 内容合作伙伴使用。
onBehalfOfContentOwner 参数表示请求的授权凭据标识了代表参数值中指定的内容所有者行事的 YouTube CMS 用户。此参数适用于拥有和管理许多不同 YouTube 频道的 YouTube 内容合作伙伴。借助此功能,内容所有者只需进行一次身份验证,即可访问其所有视频和频道数据,而无需为每个频道分别提供身份验证凭据。用户进行身份验证时使用的 CMS 账号必须与指定的 YouTube 内容所有者相关联。 |
请求正文
请求正文采用以下数据结构:
{
"videoId": string,
"reasonId": string,
"secondaryReasonId": string,
"comments": string,
"language": string
}
必要属性
您必须为以下属性设置值:
可选属性
您可以为以下属性设置值:
属性
下表定义了此资源中显示的属性:
属性 |
videoId |
string
用于标识被举报为包含滥用内容的视频。将该值设置为相应视频的 YouTube 视频 ID。 |
reasonId |
object
指定举报视频包含侮辱性内容的原因。将值设置为相应 videoAbuseReportReason 资源的 unique ID 。 |
secondaryReasonId |
object
指定被举报的视频因包含侮辱性内容而被举报的次要原因。与 reasonId 属性标识的主要原因相比,次要原因对不良内容的描述更具体。将值设置为相应次要原因的 unique ID 。 |
language |
object
用于标识报告者所说的语言。 |
响应
如果成功,此方法将返回 HTTP 204
响应代码 (No Content
)。
错误
下表列出了该 API 在响应对此方法的调用时可能会返回的错误消息。如需了解详情,请参阅错误消息文档。
错误类型 |
错误详情 |
说明 |
badRequest (400) |
invalidAbuseReason |
请求包含 reasonId 属性的非预期值,或者 reasonId 和 secondaryReasonId 属性的无效组合。 |
badRequest (400) |
rateLimitExceeded |
用户在指定时间范围内发送的请求过多。 |
forbidden (403) |
forbidden |
|
notFound (404) |
videoNotFound |
找不到您尝试举报滥用行为的视频。 |
试试看!
使用 APIs Explorer 调用此 API,并查看 API 请求和响应。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-05-05。
[null,null,["最后更新时间 (UTC):2025-05-05。"],[[["\u003cp\u003eThis API allows reporting a YouTube video for abusive content using a POST request to \u003ccode\u003ehttps://www.googleapis.com/youtube/v3/videos/reportAbuse\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eReporting a video requires setting both the \u003ccode\u003evideoId\u003c/code\u003e (the ID of the video being reported) and the \u003ccode\u003ereasonId\u003c/code\u003e (the reason for reporting the video) within the request body.\u003c/p\u003e\n"],["\u003cp\u003eThe request can optionally include \u003ccode\u003esecondaryReasonId\u003c/code\u003e, \u003ccode\u003ecomments\u003c/code\u003e, and \u003ccode\u003elanguage\u003c/code\u003e for more detailed information about the report.\u003c/p\u003e\n"],["\u003cp\u003eUtilizing this API call consumes 50 quota units and requires authorization with specific scopes, such as \u003ccode\u003ehttps://www.googleapis.com/auth/youtube\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe API will return an error if an unexpected or invalid value is entered for \u003ccode\u003ereasonId\u003c/code\u003e or \u003ccode\u003esecondaryReasonId\u003c/code\u003e and if a video is not found.\u003c/p\u003e\n"]]],["This document details how to report a YouTube video for abusive content using the `videos.reportAbuse` API endpoint. A POST request is made to the API with a quota cost of 50 units. Authorization is needed using specified scopes. The request body requires the `videoId` and `reasonId`, and can optionally include `secondaryReasonId`, `comments`, and `language`. The response returns a 204 status code upon success and specific error codes in case of failure.\n"],null,[]]