با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
Looker Studio API به شما امکان می دهد دارایی های Looker Studio را جستجو و مدیریت کنید.
مورد اصلی استفاده از API این است که به سازمانهای Google Workspace یا Cloud Identity اجازه میدهد مدیریت و انتقال داراییهای Looker Studio را خودکار کنند.
بررسی اجمالی نیازمندی ها
برای استفاده از Looker Studio API مراحل زیر لازم است:
مراحل بالا ممکن است توسط یک سازمان یا سازمان های مختلف بر اساس سناریوهای رایج زیر انجام شود:
برنامه های داخلی توسعه یافته برای یک سازمان. سازمان برنامه را برای همه کاربران سازمان خود پیکربندی و مجوز می دهد.
برنامه های شخص ثالث توسعه یافته برای کاربران/مشتریان خارجی (یعنی توسعه دهنده و کاربران متعلق به سازمان های مختلف هستند). برنامهنویس برنامه را پیکربندی میکند اما سازمان کاربر به برنامه شخص ثالث مجوز میدهد.
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
روی تأیید کلیک کنید.
پس از تأیید برنامه، هر کاربر Workspace متعلق به سازمان به طور خودکار مجاز به استفاده از برنامه با Looker Studio API خواهد بود.
3. به دست آوردن توکن های دسترسی OAuth 2.0 و فراخوانی API
پس از توسعه و تأیید برنامه، دسترسی لازم برای تماس با API برای کاربران Workspace را خواهید داشت. برای جزئیات کار با Google API با استفاده از OAuth به استفاده از OAuth 2.0 برای دسترسی به Google API مراجعه کنید. برای عملیات موجود به مرجع API مراجعه کنید.
عیب یابی
گفتگوی OAuth وجود ندارد
اگر سازمان کاربری برنامه را مجاز کرده باشد، کاربران آن سازمان هنگام تأیید برنامه، کادر گفتگوی OAuth نشان داده نمیشوند. تنها استثنا در صورتی است که برنامه برای دامنههای Google API اضافی که سرپرست Workspace پیکربندی نکرده است، درخواست مجوز کند، در این صورت گفتگوی OAuth به کاربران نشان داده میشود.
خطای 400: invalid_scope
اگر کاربر هنگام تلاش برای مجوز دادن به برنامه، پیام Error 400: invalid_scope را دریافت کرد، سازمان کاربر به برنامه اجازه نداده یا به اشتباه آن را تأیید نکرده است. برای حل این مشکل، کاربر باید درخواست کند که سازمانش مجوز برنامه را صادر کند.
تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","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-25 بهوقت ساعت هماهنگ جهانی."],[[["\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."]]