Chúng tôi đang cập nhật Data API để phù hợp với cách YouTube tính số lượt xem video ngắn.
Tìm hiểu thêm
Videos: reportAbuse
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Báo cáo một video vì chứa nội dung sai trái.
Tác động đến hạn mức: Một lệnh gọi đến phương thức này có chi phí hạn mức là 50 đơn vị.
Yêu cầu
Yêu cầu HTTP
POST https://www.googleapis.com/youtube/v3/videos/reportAbuse
Ủy quyền
Yêu cầu này yêu cầu uỷ quyền với ít nhất một trong các phạm vi sau (đọc thêm về việc xác thực và uỷ quyền).
Phạm vi |
https://www.googleapis.com/auth/youtube |
https://www.googleapis.com/auth/youtube.force-ssl |
https://www.googleapis.com/auth/youtubepartner |
Thông số
Bảng dưới đây liệt kê các tham số mà truy vấn này hỗ trợ. Tất cả các tham số được liệt kê đều là tham số truy vấn.
Thông số |
Thông số tuỳ chọn |
onBehalfOfContentOwner |
string
Bạn chỉ có thể sử dụng thông số này trong một yêu cầu được uỷ quyền hợp lệ. Lưu ý: Thông số này chỉ dành cho các đối tác nội dung của YouTube.
Thông số onBehalfOfContentOwner cho biết rằng thông tin xác thực uỷ quyền của yêu cầu xác định một người dùng CMS của YouTube đang thay mặt cho chủ sở hữu nội dung được chỉ định trong giá trị thông số. Tham số này dành cho những đối tác nội dung trên YouTube sở hữu và quản lý nhiều kênh YouTube. Tính năng này cho phép chủ sở hữu nội dung xác thực một lần và có quyền truy cập vào tất cả dữ liệu về video và kênh của họ mà không cần phải cung cấp thông tin xác thực cho từng kênh. Tài khoản CMS mà người dùng xác thực phải được liên kết với chủ sở hữu nội dung YouTube được chỉ định. |
Nội dung yêu cầu
Nội dung yêu cầu có cấu trúc dữ liệu sau:
{
"videoId": string,
"reasonId": string,
"secondaryReasonId": string,
"comments": string,
"language": string
}
Thuộc tính bắt buộc
Bạn phải đặt giá trị cho các thuộc tính sau:
Thuộc tính tuỳ chọn
Bạn có thể đặt giá trị cho các thuộc tính sau:
Thuộc tính
Bảng sau đây xác định các thuộc tính xuất hiện trong tài nguyên này:
Thuộc tính |
videoId |
string
Xác định video đang bị báo cáo vì chứa nội dung sai trái. Đặt giá trị thành mã video trên YouTube của video đó. |
reasonId |
object
Chỉ định lý do video đang được báo cáo vì chứa nội dung sai trái. Đặt giá trị thành unique ID của tài nguyên videoAbuseReportReason thích hợp. |
secondaryReasonId |
object
Chỉ định lý do phụ khiến video đang được báo cáo do chứa nội dung sai trái. Lý do phụ cung cấp nội dung mô tả cụ thể hơn về nội dung phản cảm so với lý do chính mà thuộc tính reasonId xác định. Đặt giá trị thành unique ID của lý do phụ thích hợp. |
language |
object
Xác định ngôn ngữ mà phóng viên nói. |
Phản hồi
Nếu thành công, phương thức này sẽ trả về mã phản hồi HTTP 204
(No Content
).
Lỗi
Bảng dưới đây xác định thông báo lỗi mà API có thể trả về để phản hồi lệnh gọi đến phương thức này. Vui lòng xem tài liệu về thông báo lỗi để biết thêm thông tin chi tiết.
Loại lỗi |
Thông tin chi tiết về lỗi |
Mô tả |
badRequest (400) |
invalidAbuseReason |
Yêu cầu chứa một giá trị không mong muốn cho thuộc tính reasonId hoặc một tổ hợp không hợp lệ của các thuộc tính reasonId và secondaryReasonId . |
badRequest (400) |
rateLimitExceeded |
Người dùng đã gửi quá nhiều yêu cầu trong một khung thời gian nhất định. |
forbidden (403) |
forbidden |
|
notFound (404) |
videoNotFound |
Chúng tôi không tìm thấy video mà bạn đang cố báo cáo vi phạm. |
Hãy dùng thử!
Sử dụng APIs Explorer để gọi API này và xem yêu cầu và phản hồi API.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-05-05 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-05-05 UTC."],[[["\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,["# Videos: reportAbuse\n\nReports a video for containing abusive content.\n\n**Quota impact:** A call to this method has a [quota cost](/youtube/v3/getting-started#quota) of 50 units.\n\nRequest\n-------\n\n### HTTP request\n\n```\nPOST https://www.googleapis.com/youtube/v3/videos/reportAbuse\n```\n\n### Authorization\n\nThis request requires authorization with at least one of the following scopes ([read more about authentication and authorization](/youtube/v3/guides/authentication)).\n\n| Scope |\n|-----------------------------------------------------|\n| `https://www.googleapis.com/auth/youtube` |\n| `https://www.googleapis.com/auth/youtube.force-ssl` |\n| `https://www.googleapis.com/auth/youtubepartner` |\n\n### Parameters\n\nThe table below lists the parameters that this query supports. All of the parameters listed are query parameters.\n\n| Parameters ||\n|--------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| **Optional parameters** |||\n| `onBehalfOfContentOwner` | `string` This parameter can only be used in a properly [authorized request](/youtube/v3/guides/authentication). **Note:** This parameter is intended exclusively for YouTube content partners. The **onBehalfOfContentOwner** parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. |\n\n### Request body\n\nThe request body has the following data structure: \n\n```text\n{\n \"videoId\": string,\n \"reasonId\": string,\n \"secondaryReasonId\": string,\n \"comments\": string,\n \"language\": string\n}\n```\n\n#### Required properties\n\nYou must set values for the following properties:\n\n\u003cbr /\u003e\n\n- [videoId](#videoId)\n- [reasonId](#reasonId)\n\n\u003cbr /\u003e\n\n#### Optional properties\n\nYou can set values for the following properties:\n\n\u003cbr /\u003e\n\n- [secondaryReasonId](#secondaryReasonId)\n- [comments](#comments)\n- [language](#language)\n\n\u003cbr /\u003e\n\n### Properties\n\nThe following table defines the properties that appear in this resource:\n\n| Properties ||\n|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `videoId` | `string` Identifies the video that is being reported for containing abusive content. Set the value to that video's YouTube video ID. |\n| `reasonId` | `object` Specifies the reason that the video that is being reported for containing abusive content. Set the value to the appropriate `videoAbuseReportReason` resource's [unique ID](/youtube/v3/docs/videoAbuseReportReasons#id). |\n| `secondaryReasonId` | `object` Specifies the secondary reason that the video that is being reported for containing abusive content. A secondary reason provides a more specific description of the objectionable content than the primary reason, which the `reasonId` property identifies. Set the value to the appropriate secondary reason's [unique ID](/youtube/v3/docs/videoAbuseReportReasons#snippet.secondaryReasons[].id). |\n| `comments` | `string` Provides any additional information that the reporter wants to add. |\n| `language` | `object` Identifies a language spoken by the reporter. |\n\nResponse\n--------\n\nIf successful, this method returns an HTTP `204` response code (`No Content`).\n\nErrors\n------\n\nThe table below identifies error messages that the API could return in response to a call to this method. Please see the [error message](/youtube/v3/docs/errors) documentation for more detail.\n\n| Error type | Error detail | Description |\n|--------------------|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `badRequest (400)` | `invalidAbuseReason` | The request contained an unexpected value for the `reasonId` property, or an invalid combination of the `reasonId` and `secondaryReasonId` properties. |\n| `badRequest (400)` | `rateLimitExceeded` | The user has sent too many requests in a given timeframe. |\n| `forbidden (403)` | `forbidden` | |\n| `notFound (404)` | `videoNotFound` | The video that you are trying to report abuse for cannot be found. |\n\nTry it!\n-------\n\nUse the APIs Explorer to call this API and see the API request and response."]]