เรากำลังอัปเดต Data API ให้สอดคล้องกับวิธีที่ YouTube นับยอดดูสำหรับ Shorts
ดูข้อมูลเพิ่มเติม
Videos: reportAbuse
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
รายงานวิดีโอว่ามีเนื้อหาที่เป็นการละเมิด
ผลกระทบต่อโควต้า: การเรียกใช้เมธอดนี้มีต้นทุนโควต้า 50 หน่วย
ส่งคำขอ
คำขอ HTTP
POST https://www.googleapis.com/youtube/v3/videos/reportAbuse
การให้สิทธิ์
คำขอนี้ต้องมีการให้สิทธิ์ด้วยขอบเขตต่อไปนี้อย่างน้อย 1 รายการ (อ่านเพิ่มเติมเกี่ยวกับการให้สิทธิ์และการตรวจสอบสิทธิ์)
ขอบเขต |
https://www.googleapis.com/auth/youtube |
https://www.googleapis.com/auth/youtube.force-ssl |
https://www.googleapis.com/auth/youtubepartner |
พารามิเตอร์
ตารางด้านล่างแสดงพารามิเตอร์ที่การค้นหานี้รองรับ พารามิเตอร์ทั้งหมดที่แสดงคือพารามิเตอร์การค้นหา
พารามิเตอร์ |
พารามิเตอร์ที่ไม่บังคับ |
onBehalfOfContentOwner |
string
ใช้พารามิเตอร์นี้ได้ในคำขอที่ได้รับอนุญาตอย่างถูกต้องเท่านั้น หมายเหตุ: พารามิเตอร์นี้มีไว้สำหรับพาร์ทเนอร์เนื้อหา YouTube โดยเฉพาะ
พารามิเตอร์ onBehalfOfContentOwner บ่งบอกว่าข้อมูลเข้าสู่ระบบสำหรับการให้สิทธิ์ของคำขอระบุผู้ใช้ CMS ของ YouTube ที่ดำเนินการในนามของเจ้าของเนื้อหาที่ระบุไว้ในค่าพารามิเตอร์ พารามิเตอร์นี้มีไว้สำหรับพาร์ทเนอร์เนื้อหา YouTube ที่เป็นเจ้าของและจัดการช่อง YouTube หลายช่อง ซึ่งช่วยให้เจ้าของเนื้อหาตรวจสอบสิทธิ์เพียงครั้งเดียวและเข้าถึงข้อมูลวิดีโอและข้อมูลช่องทั้งหมดได้โดยไม่ต้องระบุข้อมูลเข้าสู่ระบบการตรวจสอบสิทธิ์สำหรับแต่ละช่อง บัญชี CMS ที่ผู้ใช้ใช้ตรวจสอบสิทธิ์ต้องลิงก์กับเจ้าของเนื้อหา YouTube ที่ระบุ |
เนื้อความของคำขอ
เนื้อความของคำขอมีโครงสร้างข้อมูลดังต่อไปนี้
{
"videoId": string,
"reasonId": string,
"secondaryReasonId": string,
"comments": string,
"language": string
}
พร็อพเพอร์ตี้ที่จำเป็น
คุณต้องตั้งค่าสำหรับพร็อพเพอร์ตี้ต่อไปนี้
พร็อพเพอร์ตี้ที่ไม่บังคับ
คุณสามารถกําหนดค่าสําหรับพร็อพเพอร์ตี้ต่อไปนี้
พร็อพเพอร์ตี้
ตารางต่อไปนี้จะกำหนดพร็อพเพอร์ตี้ที่ปรากฏในทรัพยากรนี้
พร็อพเพอร์ตี้ |
videoId |
string
ระบุวิดีโอที่มีการรายงานเนื่องจากมีเนื้อหาที่เป็นการละเมิด ตั้งค่าเป็นรหัสวิดีโอ YouTube ของวิดีโอนั้น |
reasonId |
object
ระบุเหตุผลที่วิดีโอที่รายงานมีเนื้อหาที่เป็นการละเมิด ตั้งค่าเป็น unique ID ของแหล่งข้อมูล videoAbuseReportReason ที่เหมาะสม |
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 Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-05-05 UTC
[null,null,["อัปเดตล่าสุด 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."]]