Groups
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ทรัพยากร group
แสดงถึงกลุ่ม YouTube Analytics ซึ่งเป็นคอลเล็กชันที่กำหนดเองซึ่งรวบรวมช่อง วิดีโอ เพลย์ลิสต์ หรือเนื้อหาได้สูงสุด 500 รายการ
รายการทั้งหมดในกลุ่มต้องแสดงทรัพยากรประเภทเดียวกัน เช่น คุณไม่สามารถสร้างกลุ่มที่มีวิดีโอ 100 รายการและเพลย์ลิสต์ 100 รายการ
กลุ่ม Analytics ต้องมีเฉพาะทรัพยากรที่คุณอัปโหลดหรืออ้างสิทธิ์ไว้ หรือลิงก์กับช่องที่คุณดูแลเท่านั้น ด้วยเหตุนี้ เจ้าของช่องจึงสามารถสร้างกลุ่มวิดีโอและเพลย์ลิสต์ได้ เจ้าของเนื้อหาสามารถสร้างกลุ่มวิดีโอ เพลย์ลิสต์ ช่อง หรือเนื้อหาได้
เมธอด
API รองรับวิธีการต่อไปนี้สําหรับทรัพยากร groups
- list
- แสดงรายการกลุ่มที่ตรงกับพารามิเตอร์คําขอ API เช่น คุณสามารถดึงข้อมูลกลุ่มทั้งหมดที่ผู้ใช้ที่ตรวจสอบสิทธิ์เป็นเจ้าของ หรือดึงข้อมูลกลุ่มอย่างน้อย 1 กลุ่มตามรหัสที่ไม่ซ้ำกันได้
ลองใช้เลย
- แทรก
- สร้างกลุ่ม YouTube Analytics หลังจากสร้างกลุ่มแล้ว ให้ใช้เมธอด
groupItems.insert
เพื่อเพิ่มรายการลงในกลุ่ม
ลองใช้เลย
- update
- แก้ไขข้อมูลเมตาสำหรับกลุ่ม ปัจจุบันมีเพียงชื่อกลุ่มเท่านั้นที่อัปเดตได้ (ใช้
groupItems.insert
และ groupItems.delete
เพื่อเพิ่มและนำรายการกลุ่มออก)
ลองใช้เลย
- ลบ
- ลบกลุ่ม
ลองใช้เลย
พร็อพเพอร์ตี้
ตารางต่อไปนี้จะกำหนดพร็อพเพอร์ตี้ที่ปรากฏในทรัพยากรนี้
พร็อพเพอร์ตี้ |
kind |
string
ระบุประเภทของทรัพยากร API ค่าจะเป็น youtube#group |
etag |
etag
Etag ของทรัพยากรนี้ |
id |
string
รหัสที่ YouTube ใช้เพื่อระบุกลุ่มที่ไม่ซ้ำกัน |
snippet |
object
ออบเจ็กต์ snippet มีข้อมูลพื้นฐานเกี่ยวกับกลุ่ม ซึ่งรวมถึงวันที่สร้างและชื่อ |
snippet.publishedAt |
datetime
วันที่และเวลาที่สร้างกลุ่ม ค่าที่ระบุอยู่ในรูปแบบ ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ ) |
snippet.title |
string
ชื่อกลุ่ม ค่าต้องเป็นสตริงที่ไม่ว่างเปล่า |
contentDetails |
object
ออบเจ็กต์ contentDetails มีข้อมูลเพิ่มเติมเกี่ยวกับกลุ่ม เช่น จํานวนประเภทของรายการที่มี |
contentDetails.itemCount |
unsigned long
จำนวนรายการในกลุ่ม |
contentDetails.itemType |
string
ประเภททรัพยากรของกลุ่ม
ค่าที่ใช้ได้สำหรับพร็อพเพอร์ตี้นี้มีดังนี้
youtube#channel
youtube#playlist
youtube#video
youtubePartner#asset
|
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-21 UTC
[null,null,["อัปเดตล่าสุด 2025-08-21 UTC"],[[["\u003cp\u003eA YouTube Analytics group is a custom collection of up to 500 channels, videos, playlists, or assets, all of the same resource type.\u003c/p\u003e\n"],["\u003cp\u003eYou can create, retrieve, update, and delete groups using the YouTube Analytics API methods.\u003c/p\u003e\n"],["\u003cp\u003eGroups can only contain resources that you own, have claimed, or are linked to a channel you administer.\u003c/p\u003e\n"],["\u003cp\u003eThe group resource representation includes information such as the group's ID, title, creation date, item count, and item type.\u003c/p\u003e\n"],["\u003cp\u003eUse the \u003ccode\u003egroupItems\u003c/code\u003e methods to manage the individual items within a group.\u003c/p\u003e\n"]]],["YouTube Analytics groups are custom collections of up to 500 channels, videos, playlists, or assets of the same type. The API allows users to list, insert, update, and delete groups. Creating a group requires specifying the group's name. Updating a group only allows changing its title, while adding or removing items is handled through a separate method. Each group has an ID, creation date, and details about the number and type of contained items.\n"],null,["# Groups\n\nA **group** resource represents a YouTube Analytics group, which is a custom collection of up to 500 channels, videos, playlists, or assets. \n\nAll of the items in a group must represent the same type of resource. For example, you cannot create a group that contains 100 videos and 100 playlists. \n\nAn Analytics group can only contain resources that you have uploaded or claimed or that are linked to a channel that you administer. As a result, channel owners can create groups of videos and playlists. Content owners can create groups of videos, playlists, channels, or assets.\n\nMethods\n-------\n\nThe API supports the following methods for `groups` resources:\n\n[list](/youtube/analytics/reference/groups/list)\n: Returns a list of groups that match the API request parameters. For example, you can retrieve all groups that the authenticated user owns, or you can retrieve one or more groups by their unique IDs.\n [Try it now](/youtube/analytics/reference/groups/list#try-it).\n\n[insert](/youtube/analytics/reference/groups/insert)\n: Creates a YouTube Analytics group. After creating a group, use the [groupItems.insert](/youtube/analytics/reference/groupItems/insert) method to add items to the group.\n [Try it now](/youtube/analytics/reference/groups/insert#try-it).\n\n[update](/youtube/analytics/reference/groups/update)\n: Modifies the metadata for a group. Currently, the only property that can be updated is the group's title. (Use the [groupItems.insert](/youtube/analytics/reference/groupItems/insert) and [groupItems.delete](/youtube/analytics/reference/groupItems/delete) to add and remove group items.)\n [Try it now](/youtube/analytics/reference/groups/update#try-it).\n\n[delete](/youtube/analytics/reference/groups/delete)\n: Deletes a group.\n [Try it now](/youtube/analytics/reference/groups/delete#try-it).\n\nResource representation\n-----------------------\n\nThe JSON structure below shows the format of a `groups` resource: \n\n```text\n{\n \"kind\": \"youtube#group\",\n \"etag\": etag,\n \"id\": string,\n \"snippet\": {\n \"publishedAt\": datetime,\n \"title\": string\n },\n \"contentDetails\": {\n \"itemCount\": unsigned long,\n \"itemType\": string\n }\n}\n```\n\n### Properties\n\nThe following table defines the properties that appear in this resource:\n\n| Properties ||\n|----------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `kind` | `string` Identifies the API resource's type. The value will be `youtube#group`. |\n| `etag` | `etag` The Etag of this resource. |\n| `id` | `string` The ID that YouTube uses to uniquely identify the group. |\n| `snippet` | `object` The `snippet` object contains basic information about the group, including its creation date and name. |\n| snippet.`publishedAt` | `datetime` The date and time that the group was created. The value is specified in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) (`YYYY-MM-DDThh:mm:ss.sZ`) format. |\n| snippet.`title` | `string` The group name. The value must be a non-empty string. |\n| `contentDetails` | `object` The `contentDetails` object contains additional information about the group, such as the number and type of items that it contains. |\n| contentDetails.`itemCount` | `unsigned long` The number of items in the group. |\n| contentDetails.`itemType` | `string` The type of resources that the group contains. Valid values for this property are: - `youtube#channel` - `youtube#playlist` - `youtube#video` - `youtubePartner#asset` |"]]