取得授權憑證
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
您的應用程式必須具備授權憑證,才能使用 YouTube Reporting API 或 YouTube Analytics API。
本文件說明 Google API 控制台支援的不同授權憑證類型。以及如何尋找或建立專案的授權憑證。
建立專案並選取 API 服務
- 在 API 控制台中開啟「憑證」頁面。
-
這個頁面可讓您建立兩種不同類型的憑證。
不過,YouTube Reporting API 和 YouTube Analytics API 的所有方法都需要 OAuth 2.0 授權。請按照下列操作說明產生 OAuth 2.0 憑證。
-
OAuth 2.0:每當您的應用程式要求私人使用者資料時,必須一併傳送 OAuth 2.0 憑證和要求。您的應用程式會先傳送用戶端 ID,可能還會傳送用戶端密碼來取得權杖。您可以為網路應用程式、服務帳戶或已安裝的應用程式產生 OAuth 2.0 憑證。
詳情請參閱 OAuth 2.0 說明文件。
-
API 金鑰:
您可以選擇在要求中加入 API 金鑰。
金鑰可用來識別專案,並為您提供 API 存取權、配額和報表。
請注意,YouTube Reporting API 和 YouTube Analytics API 的所有方法都需要 OAuth 2.0 授權。因此,您必須按照上述操作說明產生 OAuth 2.0 憑證。如有需要,您也可以傳送 API 金鑰,但這並非必要。
API 支援數種類型的 API 金鑰限制。如果您還沒有所需的 API 金鑰,請依序點選「建立憑證」
>「API 金鑰」,在控制台中建立 API 金鑰。您可以在實際工作環境中使用金鑰先加以限制,方法是點選「限制金鑰」並選取其中一個限制。
為確保您 API 金鑰的安全,請遵循安全使用 API 金鑰的最佳做法。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-03-06 (世界標準時間)。
[[["容易理解","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-03-06 (世界標準時間)。"],[[["Applications need authorization credentials to use the YouTube Reporting API or the YouTube Analytics API."],["The Google API Console supports different types of credentials, but the YouTube Reporting API and YouTube Analytics API require OAuth 2.0 authorization."],["OAuth 2.0 credentials, which involve a client ID and potentially a client secret, are needed for applications requesting private user data."],["API keys can be used to identify a project and provide API access, but are not necessary for the YouTube Reporting API and the YouTube Analytics API."],["You can generate OAuth 2.0 credentials for web applications, service accounts, or installed applications."]]],["To use the YouTube Reporting or Analytics APIs, applications need authorization credentials. Navigate to the Credentials page in the Google API Console to create them. While API keys can be created and optionally used, OAuth 2.0 credentials are required for all methods in these APIs. Generate OAuth 2.0 credentials, including a client ID and secret. API keys identify your project and can be restricted for security, but are not a replacement for OAuth 2.0 tokens.\n"]]