השלבים שלמעלה יכולים להתבצע על ידי אותו ארגון או על ידי ארגונים שונים, בהתאם לתרחישים הנפוצים הבאים:
אפליקציות פנימיות שפותחו לארגון. הארגון מגדיר את האפליקציה ומאשר אותה לכל המשתמשים בארגון.
אפליקציות צד שלישי שפותחו עבור משתמשים או לקוחות חיצוניים (כלומר, המפתח והמשתמשים שייכים לארגונים שונים). המפתח מגדיר את האפליקציה, אבל הארגון של המשתמש מאשר את האפליקציה של הצד השלישי.
בוחרים את האפשרות המתאימה Application Type. (אפליקציית אינטרנט היא הנפוצה ביותר).
ממלאים את שדות החובה ולוחצים על יצירה.
חשוב לשים לב למזהה הלקוח כי הוא משמש לאישור האפליקציה.
2. איך נותנים הרשאה לאפליקציה לארגון
אפליקציות שמשתמשות ב-Looker Studio API יכולות לאמת ולתת הרשאה למשתמשי Google Workspace רק אם הארגון של המשתמש נתן הרשאה לאפליקציה באמצעות הענקת גישה ברמת הדומיין כדי לשלוט בגישה ל-API.
מגדירים האצלת סמכויות ברמת הדומיין באמצעות מזהה הלקוח של האפליקציה ב-OAuth והיקפי ההרשאות שנדרשים לאפליקציה.
מזינים את Client ID של האפליקציה כדי לאשר אותה (כלומר, האפליקציה שמשתמשת ב-Looker Studio API).
מזינים את כל היקפי ההרשאות של OAuth שנדרשים לאפליקציה. היקפי ההרשאות הבאים מבוקשים בדרך כלל אם משתמשים ב-Looker Studio API כדי לנהל נכסים:
https://www.googleapis.com/auth/datastudio
https://www.googleapis.com/auth/userinfo.profile
לוחצים על Authorize.
אחרי אישור האפליקציה, כל משתמש ב-Workspace ששייך לארגון יקבל אישור אוטומטי להשתמש באפליקציה עם Looker Studio API.
3. קבלת אסימוני גישה מסוג OAuth 2.0 וקריאה לממשק ה-API
אחרי שתפתחו ותאשרו את האפליקציה, תהיה לכם הגישה הדרושה להפעלת ה-API עבור משתמשי Workspace. פרטים על עבודה עם Google APIs באמצעות OAuth זמינים במאמר שימוש ב-OAuth 2.0 כדי לגשת אל Google APIs. מידע על הפעולות הזמינות מופיע בהפניות ל-API.
פתרון בעיות
תיבת דו-שיח חסרה של OAuth
אם הארגון של המשתמש אישר את האפליקציה, משתמשים בארגון הזה לא יראו את תיבת הדו-שיח של OAuth כשהם יאשרו את האפליקציה. היוצא מן הכלל היחיד הוא אם האפליקציה תבקש הרשאה להיקפי הרשאות נוספים של Google API שהאדמין ב-Workspace לא הגדיר. במקרה כזה, תיבת הדו-שיח של OAuth תוצג למשתמשים.
שגיאה 400: invalid_scope
אם משתמש מקבל הודעה על Error 400: invalid_scope כשהוא מנסה לתת הרשאה לאפליקציה, סימן שהארגון שלו לא נתן הרשאה לאפליקציה או שההרשאה לא ניתנה בצורה נכונה. כדי לפתור את הבעיה, המשתמש יצטרך לבקש מהארגון שלו לתת הרשאה לאפליקציה.
[[["התוכן קל להבנה","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-26 (שעון UTC)."],[[["\u003cp\u003eThe Looker Studio API enables programmatic management of Looker Studio assets, primarily for automation and migration within Google Workspace or Cloud Identity organizations.\u003c/p\u003e\n"],["\u003cp\u003eBefore using the API, you must configure an app, authorize it via the Google Admin console (requiring domain-wide delegation), and then obtain OAuth 2.0 access tokens for API calls.\u003c/p\u003e\n"],["\u003cp\u003eThe API is exclusively available to users within organizations that have Google Workspace or Cloud Identity.\u003c/p\u003e\n"],["\u003cp\u003eWhen a Workspace admin authorizes an app with the necessary scopes, users in that organization are automatically authorized to use the app with the Looker Studio API.\u003c/p\u003e\n"],["\u003cp\u003eCommon troubleshooting issues include a missing OAuth dialog (expected behavior if the app is authorized) and "Error 400: invalid_scope" indicating the app hasn't been authorized by the user's organization.\u003c/p\u003e\n"]]],[],null,["# Looker Studio API\n\nThe Looker Studio API allows you to search for and manage Looker Studio assets.\n\nThe primary use case for the API is to allow Google Workspace or Cloud Identity\norganizations to automate management and migration of Looker Studio assets.\n| **Key Point:** The API is only available to users that belong to an organization with Google Workspace or Cloud Identity.\n\nRequirements overview\n---------------------\n\nThe following steps are required to use the Looker Studio API:\n\n1. [Configure an app to use the API](#configure-app).\n2. [Use the Google Admin console to authorize the app](#authorize-app).\n3. [Obtain OAuth 2.0 access tokens and call the API](#calling-api).\n\nThe steps above may be performed by the same or different organizations based on\nthe following common scenarios:\n\n- **Internal apps** developed for an organization. The organization configures and authorizes the app for all users of their organization.\n- **3rd-party apps** developed for external users/customers (i.e. developer and users belong to different organizations). The developer configures the app but the user's organization authorizes the 3rd-party app.\n\n1. Configure an app to use the API\n----------------------------------\n\nComplete the following to configure your app:\n\n- [Enable the API](#enable_the_api)\n- [Create an OAuth client](#create_an_oauth_client)\n\n#### Enable the API\n\nTo enable an API for your project:\n\n1. Open the [Looker Studio API](https://console.cloud.google.com/apis/library/datastudio.googleapis.com) in the Google API Console.\n2. If prompted, select a project, or create a new one.\n3. Click **Enable**.\n4. If prompted, read and accept the API's Terms of Service.\n\n#### Create an OAuth Client\n\nThe following steps to create an OAuth Client are general guidelines and should\nbe adjusted to meet your app requirements.\n| **Important:** Don't add Looker Studio scopes to your OAuth Client. The scopes will be added by the Workspace admin when they authorize the app.\n\n1. Navigate to [Configure OAuth consent screen](https://console.cloud.google.com/apis/credentials/consent).\n 1. Choose **Internal** , click **Create**.\n 2. Fill out required fields, click **Save**.\n2. Navigate to [Credentials](https://console.cloud.google.com/apis/credentials).\n 1. Click **CREATE CREDENTIALS**.\n 2. Select **OAuth client ID**.\n 3. Choose the appropriate `Application Type`. (Web application is most common).\n 4. Fill required fields, click **Create**.\n3. Take note of the **Client ID** since it is used to authorize the app.\n\n2. Authorize the app for an organization\n----------------------------------------\n\nApps using the Looker Studio API can only authenticate and authorize Google\nWorkspace users where the user's organization has authorized the app using\n[Domain-wide delegation to control API access](https://support.google.com/a/answer/162106).\n\nConfigure *domain-wide delegation* with the OAuth **Client ID** of the app and\nthe **Scopes** required by the app.\n| **Important:** The following steps must be completed by a Workspace admin. The admin will need the **OAuth Client ID** of the app and a list of **OAuth Scopes** required by the app.\n\n1. Sign in to your Google Admin console and navigate to [domain wide delegation](https://admin.google.com/ac/owl/domainwidedelegation).\n2. In `API clients`, click **Add new**.\n3. Enter the `Client ID` of the app to authorize (i.e. the app that uses the Looker Studio API).\n4. Enter **all** OAuth scopes required by the app. The following scopes are commonly requested if using the Looker Studio API to manage assets:\n - `https://www.googleapis.com/auth/datastudio`\n - `https://www.googleapis.com/auth/userinfo.profile`\n5. Click **Authorize**.\n\n| **Note:** If your app doesn't need to manage Looker Studio assets, consider using the more restrictive `https://www.googleapis.com/auth/datastudio.readonly` scope instead of `https://www.googleapis.com/auth/datastudio`.\n\nAfter authorizing the app, any Workspace user belonging to the organization will\nautomatically be authorized to use the app with the Looker Studio API.\n\n3. Obtaining OAuth 2.0 access tokens and calling the API\n--------------------------------------------------------\n\nOnce you have developed and authorized the app you will have the necessary\naccess to call the API for Workspace users. See\n[Using OAuth 2.0 to Access Google APIs](/identity/protocols/OAuth2) for details on working with Google APIs\nusing OAuth. Refer to the [API reference](/looker-studio/integrate/api/reference) for available operations.\n\nTroubleshooting\n---------------\n\n### Missing OAuth dialog\n\nIf a user's organization has [authorized the app](#authorize-app), users of that organization\nwill not be shown the OAuth dialog when authorizing the app. The only exception\nwould be if the app requests authorization for additional Google API scopes that\nthe Workspace Admin hasn't configured, in which case the OAuth dialog will be\nshown to users.\n\n### Error 400: invalid_scope\n\nIf a user receives an `Error 400: invalid_scope` message when attempting to\nauthorize the app, then the user's organization has not or incorrectly\n[authorized the app](#authorize-app). To resolve the issue, the user will have to request that\ntheir organization authorize the app."]]