קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
אפליקציות YouTube Reporting API ו-YouTube Analytics API תומכות בפרוטוקול OAuth 2.0 למתן הרשאת גישה לנתונים פרטיים של משתמשים.
בהמשך מוסברים כמה מושגים מרכזיים של OAuth 2.0:
כשמשתמש מנסה להשתמש בתכונות באפליקציה שלכם שדורשות ממנו להתחבר ל-Google Account or YouTube account, האפליקציה מתחילה את תהליך ההרשאה של OAuth 2.0.
האפליקציה מפנה את המשתמש לשרת ההרשאות של Google. הקישור לדף הזה מציין את scope הגישה שהאפליקציה שלכם מבקשת לחשבון של המשתמש. ב-scope מוגדרים המשאבים שהאפליקציה יכולה לאחזר, להוסיף, לעדכן או למחוק כשהיא פועלת בתור המשתמש המאומת.
אם המשתמש מסכים לאשר לאפליקציה שלכם לגשת למשאבים האלה, Google מחזירה אסימון לאפליקציה. בהתאם לסוג האפליקציה, היא מאמתת את האסימון או מחליפה אותו בסוג אחר של אסימון.
לדוגמה, אפליקציית אינטרנט בצד השרת ממירה את האסימון שמוחזר לאסימון גישה ולאסימון רענון. אסימון הגישה מאפשר לאפליקציה לאשר בקשות בשם המשתמש, ואסימון הרענון מאפשר לאפליקציה לאחזר אסימון גישה חדש כשתוקף אסימון הגישה המקורי פג.
תהליך העבודה של אפליקציות לנייד ולמחשב תומך באפליקציות שמותקנות במכשיר, כמו טלפון או מחשב.
תהליך OAuth 2.0 לטלוויזיות ולמכשירים עם יכולות קלט מוגבלות תומך במכשירים עם יכולות קלט מוגבלות, כמו קונסולות משחקים ומצלמות וידאו.
The YouTube Reporting and YouTube Analytics APIs do not currently support the OAuth 2.0 flow for devices.
תהליך OAuth 2.0 לחשבונות שירות תומך באינטראקציות בין שרתים שלא ניגשות למידע על משתמשים.
עם זאת, אי אפשר להשתמש בתהליך הזה ב-YouTube Reporting API וב-YouTube Analytics API.
Since there is no way to link a Service Account to a YouTube account, attempts to authorize requests with this flow will generate an error.
זיהוי היקפי גישה
היקפי הרשאות מאפשרים לאפליקציה לבקש גישה רק למשאבים שהיא צריכה, וגם מאפשרים למשתמשים לשלוט בהיקף הגישה שהם מעניקים לאפליקציה. לכן, יכול להיות שיהיה קשר הפוך בין מספר ההיקפים המבוקשים לבין הסבירות לקבלת הסכמת המשתמש.
לפני שמתחילים להטמיע הרשאה מסוג OAuth 2.0, מומלץ לזהות את היקפי ההרשאות שהאפליקציה תזדקק להם כדי לגשת למשאבים.
ה-API של YouTube Analytics משתמש בהיקפי ההרשאות הבאים:
היקף
תיאור
https://www.googleapis.com/auth/youtube
ניהול חשבון YouTube שלך
https://www.googleapis.com/auth/youtube.readonly
הצגת חשבון YouTube שלך
https://www.googleapis.com/auth/youtubepartner
הצגה וניהול של הנכסים והתכנים הקשורים שלך ב-YouTube
[[["התוכן קל להבנה","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-07-16 (שעון UTC)."],[[["The YouTube Reporting API and YouTube Analytics API utilize OAuth 2.0 for authorizing access to private user data."],["OAuth 2.0 requires user consent, and the scope requested determines the resources the application can access, with a possible inverse relationship between the number of scopes and the likelihood of consent."],["Google's OAuth 2.0 supports various flows including server-side web apps, JavaScript web apps, and mobile/desktop apps, but it doesn't support the device flow for YouTube Reporting and Analytics APIs, or the service account flow."],["Before implementing OAuth 2.0, it's recommended to identify the necessary scopes, with specific scopes for the YouTube Analytics API and YouTube Reporting API being detailed, as well as a document containing a full list of possible scopes for Google APIs."],["If your application uses scopes that permit access to certain user data, you might need to complete a verification process, especially if you encounter an \"unverified app\" warning."]]],["OAuth 2.0 authorizes access to private YouTube user data. Applications initiate authorization, directing users to Google's server to specify access scopes. User consent grants a token, which can be exchanged for access and refresh tokens. Credentials must be obtained via the Google API Console. Supported flows include server-side, JavaScript, and mobile/desktop apps, but not limited-input devices or service accounts. Scopes, defined for YouTube Analytics and Reporting APIs, dictate resource access and influence user consent. Public apps accessing user data must undergo verification.\n"]]