نحن بصدد تعديل Data API لتتطابق مع طريقة YouTube في احتساب مشاهدات Shorts.
مزيد من المعلومات
MembershipsLevels: list
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
ملاحظة: يمكن لصنّاع المحتوى الفرديين استخدام نقطة النهاية هذه لتقديم طلبات إلى قنواتهم الخاصة على YouTube والتي تم تفعيل ميزة "العضوية في القنوات" فيها. يمكنك التواصل مع ممثّل عن Google أو YouTube لطلب إذن الوصول.
يسرد مستويات العضوية في القناة التي سمحت بالطلب. يتم عرض المستويات
بترتيب العرض الضمني. تؤدي طلبات واجهة برمجة التطبيقات إلى هذه الطريقة إلى عرض أحد الردود التالية:
- إذا فعّل صانع المحتوى ميزة "العضوية في القنوات" وكانت له مستويات أسعار، ستتضمّن استجابة واجهة برمجة التطبيقات قائمة المستويات.
- إذا فعّل صانع المحتوى ميزة "العضوية في القنوات" ولكنه لم يحدّد مستويات التسعير،
ستحتوي استجابة واجهة برمجة التطبيقات على قائمة فارغة.
- وإذا لم يفعّل صانع المحتوى ميزة "الاشتراك الداعم للقناة"، تعرض واجهة برمجة التطبيقات الخطأ
channelMembershipsNotEnabled
.
تأثير الحصة: يتم احتساب تكلفة الحصة للمكالمة إلى هذه الطريقة بمقدار وحدة واحدة.
الطلب
طلب HTTP
GET https://www.googleapis.com/youtube/v3/membershipsLevels
يتطلب هذا الطلب تفويضًا بالنطاق التالي:
النطاق |
https://www.googleapis.com/auth/youtube.channel-memberships.creator |
المَعلمات
يسرد الجدول التالي المعلَمات التي يتيحها طلب البحث هذا. كلّ المَعلمات المدرَجة هي مَعلمات طلب بحث.
المَعلمات |
المَعلمات المطلوبة |
part |
string
تحدّد المعلَمة part سمات الموارد membershipsLevel التي ستشملها استجابة واجهة برمجة التطبيقات. وتكون قيمة المعلَمة قائمة بأجزاء من الموارد مفصولة بفواصل. تعرض القائمة التالية الأجزاء التي يمكن
استردادها:
|
نص الطلب
لا تقدِّم نص طلب عند استدعاء هذه الطريقة.
الإجابة
إذا نجحت هذه الطريقة، ستعرض هذه الطريقة نص استجابة بالبنية التالية:
{
"kind": "youtube#membershipsLevelListResponse",
"etag": etag,
"items": [
membershipsLevel Resource
]
}
أماكن إقامة
يحدد الجدول التالي الخصائص التي تظهر في هذا المورد:
أماكن إقامة |
kind |
string
يحدّد نوع مورد واجهة برمجة التطبيقات. ستكون القيمة youtube#membershipsLevelListResponse . |
etag |
etag
علامة هذا المرجع. |
items[] |
list
قائمة تضمّ membershipsLevel مورد تملك القناة التي سمحت بإرسال طلب البيانات من واجهة برمجة التطبيقات |
الأخطاء
يحدّد الجدول التالي رسائل الخطأ التي يمكن أن تعرضها واجهة برمجة التطبيقات استجابةً لطلب بيانات إلى هذه الطريقة. يُرجى الاطّلاع على وثائق رسالة الخطأ للحصول على مزيد من التفاصيل.
نوع الخطأ |
تفاصيل الخطأ |
الوصف |
badRequest (400) |
channelMembershipsNotEnabled |
إنّ قناة صانع المحتوى التي تسمح بالطلب غير مفعّلة
في ميزة "العضوية في القنوات". |
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2024-04-26 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2024-04-26 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eThis API endpoint allows individual YouTube creators with channel memberships enabled to retrieve a list of their channel's membership levels.\u003c/p\u003e\n"],["\u003cp\u003eThe 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.\u003c/p\u003e\n"],["\u003cp\u003eA successful request returns a JSON response containing the resource type, Etag, and a list of \u003ccode\u003emembershipsLevel\u003c/code\u003e resources.\u003c/p\u003e\n"],["\u003cp\u003eRequests to this method have a quota cost of 1 unit and require authorization with the scope \u003ccode\u003ehttps://www.googleapis.com/auth/youtube.channel-memberships.creator\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe request requires the \u003ccode\u003epart\u003c/code\u003e parameter with a string value that can contain either \u003ccode\u003eid\u003c/code\u003e, \u003ccode\u003esnippet\u003c/code\u003e, or both, as comma separated values.\u003c/p\u003e\n"]]],["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"],null,["# MembershipsLevels: list\n\nNote: This endpoint can only be used by individual creators to make requests for their own, channel-memberships-enabled YouTube channel. Reach out to your Google or YouTube representative to request access.\n\nLists membership levels for the channel that authorized the request. Levels are returned in\nimplicit display order. API requests to this method yield one of the following responses:\n\n- If the creator has enabled channel memberships and has pricing levels, then the API response contains the list of levels.\n- If the creator has enabled channel memberships but has not defined pricing levels, then the API response contains an empty list.\n- If the creator has not enabled channel memberships, the API returns a [channelMembershipsNotEnabled](#errors) error.\n\n**Quota impact:** A call to this method has a\n[quota cost](/youtube/v3/getting-started#quota) of 1 unit.\n\nRequest\n-------\n\n### HTTP request\n\n```\nGET https://www.googleapis.com/youtube/v3/membershipsLevels\n```\nThis request requires authorization with the following scope:\n\n| Scope |\n|-----------------------------------------------------------------------|\n| `https://www.googleapis.com/auth/youtube.channel-memberships.creator` |\n\n### Parameters\n\nThe following table lists the parameters that this query supports. All of the parameters listed are query parameters.\n\n| Parameters ||\n|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| **Required parameters** |||\n| `part` | `string` The **part** parameter specifies the `membershipsLevel` resource properties that the API response will include. The parameter value is a comma-separated list of resource parts. The following list shows the parts that can be retrieved: - `id` - `snippet` |\n\n### Request body\n\nDo not provide a request body when calling this method.\n\nResponse\n--------\n\nIf successful, this method returns a response body with the following structure: \n\n```objective-c\n{\n \"kind\": \"youtube#membershipsLevelListResponse\",\n \"etag\": etag,\n \"items\": [\n membershipsLevel Resource\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#membershipsLevelListResponse`. |\n| `etag` | `etag` The Etag of this resource. |\n| `items[]` | `list` A list of `membershipsLevel` resources owned by the channel that authorized the API request. |\n\nErrors\n------\n\nThe following table 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)` | `channelMembershipsNotEnabled` | The creator channel authorizing the request does not have channel memberships enabled. |"]]