MembershipsLevels: list
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
注意:只有個別創作者才能使用這個端點,為自己啟用頻道會員功能的 YouTube 頻道提出要求。如需存取權限,請聯絡 Google 或 YouTube 代表。
列出授權要求頻道的會員等級。等級會以隱含顯示順序傳回。向這個方法發出的 API 要求會產生下列其中一個回應:
配額影響:呼叫這個方法的配額為 1 個單位。
要求
HTTP 要求
GET https://www.googleapis.com/youtube/v3/membershipsLevels
這項要求需要取得下列範圍的授權:
內容範圍 |
https://www.googleapis.com/auth/youtube.channel-memberships.creator |
參數
下表列出此查詢支援的參數。這裡列出的參數全都是查詢參數。
參數 |
必要參數 |
part |
string
part 參數會指定 API 回應會包含的 membershipsLevel 資源屬性。參數值是以半形逗號分隔的資源部分清單。以下清單列出可擷取的部分:
|
回應
如果成功的話,這個方法會傳回回應內文,其結構如下:
{
"kind": "youtube#membershipsLevelListResponse",
"etag": etag,
"items": [
membershipsLevel Resource
]
}
屬性
下表定義了這項資源中顯示的屬性:
屬性 |
kind |
string 識別 API 資源的類型。值為 youtube#membershipsLevelListResponse 。 |
etag |
etag
這項資源的 Etag。 |
items[] |
list
列出授權 API 要求的頻道所擁有的 membershipsLevel 資源。 |
錯誤
下表列出 API 回應此方法時可能傳回的錯誤訊息。詳情請參閱錯誤訊息的說明文件。
錯誤類型 |
錯誤詳細資料 |
說明 |
badRequest (400) |
channelMembershipsNotEnabled |
授權要求的創作者頻道未啟用頻道會員功能。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-04-26 (世界標準時間)。
[[["容易理解","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"]],["上次更新時間:2024-04-26 (世界標準時間)。"],[[["This API endpoint allows individual YouTube creators with channel memberships enabled to retrieve a list of their channel's membership levels."],["The API response will either include a list of membership levels, an empty list if memberships are enabled but no levels are set, or an error if memberships are not enabled."],["A successful request returns a JSON response containing the resource type, Etag, and a list of `membershipsLevel` resources."],["Requests to this method have a quota cost of 1 unit and require authorization with the scope `https://www.googleapis.com/auth/youtube.channel-memberships.creator`."],["The request requires the `part` parameter with a string value that can contain either `id`, `snippet`, or both, as comma separated values."]]],["This API endpoint allows individual creators to retrieve channel membership levels for their YouTube channel. A `GET` request requires authorization with the `youtube.channel-memberships.creator` scope and the `part` parameter to specify the properties. The response, in JSON format, lists membership levels or an empty list if levels are undefined. If channel memberships aren't enabled, the API returns a `channelMembershipsNotEnabled` error. This method has a quota cost of 1 unit per call.\n"]]