เรากำลังอัปเดต Data API ให้สอดคล้องกับวิธีที่ YouTube นับยอดดูสำหรับ Shorts
ดูข้อมูลเพิ่มเติม
ChannelSections
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ทรัพยากร channelSection
มีข้อมูลเกี่ยวกับชุดของ
วิดีโอที่ช่องเลือกที่จะแสดง ตัวอย่างเช่น ส่วนหนึ่งอาจมี
รายการที่อัปโหลดล่าสุด การอัปโหลดยอดนิยม หรือวิดีโอจากเพลย์ลิสต์อย่างน้อย 1 รายการ
ช่องสามารถสร้างชั้นวางได้สูงสุด 10 ชั้น
เมธอด
API รองรับเมธอดต่อไปนี้สำหรับทรัพยากร channelSections
- list
- แสดงผลรายการทรัพยากร
channelSection
ที่ตรงกับเกณฑ์คำขอ API
ลองใช้เลย
- แทรก
- เพิ่มส่วนช่องในช่องของผู้ใช้ที่ผ่านการตรวจสอบสิทธิ์แล้ว ช่องสามารถสร้างชั้นวางได้สูงสุด 10 ชั้น
ลองใช้เลย
- อัปเดต
- อัปเดตส่วนช่อง
ลองใช้เลย
- ลบ
- ลบส่วนช่อง
ลองใช้เลย
พร็อพเพอร์ตี้
ตารางต่อไปนี้ระบุพร็อพเพอร์ตี้ที่ปรากฏในทรัพยากรนี้
พร็อพเพอร์ตี้ |
kind |
string
ระบุประเภทของทรัพยากร API ค่าจะเป็น youtube#channelSection |
etag |
etag
Etag ของทรัพยากรนี้ |
id |
string
รหัสที่ YouTube ใช้เพื่อระบุส่วนช่องโดยไม่ซ้ำกัน |
snippet |
object
ออบเจ็กต์ snippet มีรายละเอียดพื้นฐานเกี่ยวกับส่วนช่อง เช่น ประเภทและชื่อ |
snippet.type |
string
ประเภทของส่วนแชแนล
ค่าที่ถูกต้องสำหรับคุณสมบัตินี้คือ
allPlaylists
completedEvents
liveEvents
multipleChannels
multiplePlaylists
popularUploads
recentUploads
singlePlaylist
subscriptions
upcomingEvents
|
snippet.channelId |
string
รหัสที่ YouTube ใช้เพื่อระบุช่องที่เผยแพร่ส่วนช่องโดยไม่ซ้ำกัน |
snippet.title |
string
ชื่อของส่วน คุณสามารถตั้งค่าชื่อของส่วนช่องที่มีค่า snippet.type เป็น multiplePlaylists หรือ multipleChannels เท่านั้น และอันที่จริง คุณต้องระบุชื่อเมื่อแทรกหรืออัปเดตส่วนประเภทดังกล่าว หากคุณระบุชื่อสำหรับส่วนช่องประเภทอื่นๆ ระบบจะไม่สนใจค่า
ค่าของพร็อพเพอร์ตี้นี้มีความยาวสูงสุด 100 อักขระ และอาจมีอักขระ UTF-8 ที่ถูกต้องทั้งหมดยกเว้น < และ < |
snippet.position |
unsigned integer
ตำแหน่งของส่วนในหน้าช่อง พร็อพเพอร์ตี้นี้ใช้ดัชนีฐาน 0 ค่าของ 0 คือส่วนแรกที่ปรากฏบนช่อง ส่วนค่า 1 จะระบุส่วนที่ 2 เป็นต้น
หากไม่ได้ระบุค่าสำหรับพร็อพเพอร์ตี้นี้เมื่อแทรกส่วนช่อง ลักษณะการทำงานเริ่มต้นคือการแสดงส่วนใหม่เป็นลำดับท้ายสุด |
contentDetails |
object
ออบเจ็กต์ contentDetails มีรายละเอียดเกี่ยวกับเนื้อหาในส่วนช่อง เช่น รายการเพลย์ลิสต์หรือช่องที่มีในส่วน |
contentDetails.playlists[] |
list
รายการรหัสเพลย์ลิสต์อย่างน้อย 1 รายการที่แสดงในส่วนช่อง คุณต้องระบุรายการรหัสเพลย์ลิสต์หากพร็อพเพอร์ตี้ snippet.type ของทรัพยากร channelSection เป็น singlePlaylist หรือ multiplePlaylists และไม่ควรระบุพร็อพเพอร์ตี้นี้สำหรับส่วนประเภทอื่นๆ หากประเภทคือ singlePlaylist รายการนี้ต้องระบุรหัสเพลย์ลิสต์ 1 รายการ |
contentDetails.channels[] |
list
รายการรหัสช่องอย่างน้อย 1 รายการที่แสดงในส่วนช่อง คุณต้องระบุรายการรหัสแชแนลหากพร็อพเพอร์ตี้ snippet.type ของทรัพยากร channelSection คือ multipleChannels และไม่ควรระบุพร็อพเพอร์ตี้นี้สำหรับส่วนประเภทอื่นๆ คุณไม่สามารถรวมช่องของคุณเองไว้ในรายการได้ |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-21 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-08-21 UTC"],[[["\u003cp\u003eA \u003ccode\u003echannelSection\u003c/code\u003e resource contains information about a set of videos that a channel features, such as latest uploads, popular uploads, or playlists.\u003c/p\u003e\n"],["\u003cp\u003eChannels can manage their featured videos using the API, which allows creating, listing, updating, and deleting \u003ccode\u003echannelSection\u003c/code\u003e resources.\u003c/p\u003e\n"],["\u003cp\u003eA channel can have a maximum of 10 sections, each with a specified type like \u003ccode\u003esinglePlaylist\u003c/code\u003e, \u003ccode\u003emultipleChannels\u003c/code\u003e, or \u003ccode\u003epopularUploads\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eEach \u003ccode\u003echannelSection\u003c/code\u003e has properties such as \u003ccode\u003ekind\u003c/code\u003e, \u003ccode\u003eetag\u003c/code\u003e, \u003ccode\u003eid\u003c/code\u003e, \u003ccode\u003esnippet\u003c/code\u003e, and \u003ccode\u003econtentDetails\u003c/code\u003e, which specify details about the section and its contents.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003econtentDetails\u003c/code\u003e property can contain a list of either playlists or channels featured in the section, depending on the \u003ccode\u003esnippet.type\u003c/code\u003e property.\u003c/p\u003e\n"]]],["Channel sections feature a curated set of videos, like latest or popular uploads, or playlists. API methods allow listing, inserting, updating, and deleting these sections. A channel can have up to 10 sections. Each section contains `snippet` and `contentDetails` objects which describes the type, title, position, and the featured channels/playlists. The type can be single or multiple playlists, or channels, amongst others. Specific titles are required for some types and cannot include \"\u003c\" or \"\u003e\".\n"],null,["# ChannelSections\n\nA **channelSection** resource contains information about a set of\nvideos that a channel has chosen to feature. For example, a section could feature a channel's\nlatest uploads, most popular uploads, or videos from one or more playlists. \n\n\nA channel can create a maximum of 10 shelves.\n\nMethods\n-------\n\nThe API supports the following methods for `channelSections` resources:\n\n[list](/youtube/v3/docs/channelSections/list)\n: Returns a list of `channelSection` resources that match the API request criteria.\n [Try it now](/youtube/v3/docs/channelSections/list#usage).\n\n[insert](/youtube/v3/docs/channelSections/insert)\n: Adds a channel section to the authenticated user's channel. A channel can create a maximum of 10 shelves.\n [Try it now](/youtube/v3/docs/channelSections/insert#usage).\n\n[update](/youtube/v3/docs/channelSections/update)\n: Updates a channel section.\n [Try it now](/youtube/v3/docs/channelSections/update#usage).\n\n[delete](/youtube/v3/docs/channelSections/delete)\n: Deletes a channel section.\n [Try it now](/youtube/v3/docs/channelSections/delete#usage).\n\nResource representation\n-----------------------\n\nThe following JSON structure shows the format of a `channelSections` resource: \n\n```carbon\n{\n \"#kind\": \"youtube#channelSection\",\n \"#etag\": etag,\n \"#id\": string,\n \"#snippet\": {\n \"#snippet.type\": string,\n \"#snippet.channelId\": string,\n \"#snippet.title\": string,\n \"#snippet.position\": unsigned integer\n },\n \"#contentDetails\": {\n \"#contentDetails.playlists[]\": [\n string\n ],\n \"#contentDetails.channels[]\": [\n string\n ]\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#channelSection`. |\n| `etag` | `etag` The Etag of this resource. |\n| `id` | `string` The ID that YouTube uses to uniquely identify the channel section. |\n| `snippet` | `object` The `snippet` object contains basic details about the channel section, such as its type and title. |\n| snippet.`type` | `string` The channel section's type. Valid values for this property are: - `allPlaylists` - `completedEvents` - `liveEvents` - `multipleChannels` - `multiplePlaylists` - `popularUploads` - `recentUploads` - `singlePlaylist` - `subscriptions` - `upcomingEvents` |\n| snippet.`channelId` | `string` The ID that YouTube uses to uniquely identify the channel that published the channel section. |\n| snippet.`title` | `string` The section's title. You can only set the title of a channel section that has a `snippet.type` value of either `multiplePlaylists` or `multipleChannels`, and, in fact, you must specify a title when inserting or updating either of those types of sections. If you specify a title for other types of channel sections, the value will be ignored. This property's value has a maximum length of 100 characters and may contain all valid UTF-8 characters except **\\\u003c** and **\\\u003e**. |\n| snippet.`position` | `unsigned integer` The section's position on the channel page. This property uses a 0-based index. A value of `0` identifies the first section that appears on the channel, a value of `1` identifies the second section, and so forth. If you do not specify a value for this property when inserting a channel section, the default behavior is to display the new section last. |\n| `contentDetails` | `object` The `contentDetails` object contains details about the channel section's content, such as a list of playlists or channels featured in the section. |\n| contentDetails.`playlists[]` | `list` A list of one or more playlist IDs that are featured in a channel section. You must specify a list of playlist IDs if the `channelSection` resource's `snippet.type` property is either `singlePlaylist` or `multiplePlaylists`, and this property should not be specified for other types of sections. If the type is `singlePlaylist`, this list must specify exactly one playlist ID. |\n| contentDetails.`channels[]` | `list` A list of one or more channel IDs that are featured in a channel section. You must specify a list of channel IDs if the `channelSection` resource's `snippet.type` property is `multipleChannels`, and this property should not be specified for other types of sections. You cannot include your own channel in the list. |"]]