Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Looker Studio API cho phép bạn tìm kiếm và quản lý các thành phần trong Looker Studio.
Trường hợp sử dụng chính của API này là cho phép các tổ chức sử dụng Google Workspace hoặc Cloud Identity tự động hoá việc quản lý và di chuyển các thành phần trong Looker Studio.
Tổng quan về các yêu cầu
Bạn phải thực hiện các bước sau để sử dụng Looker Studio API:
Các bước trên có thể được thực hiện bởi cùng một hoặc nhiều tổ chức dựa trên các trường hợp phổ biến sau:
Ứng dụng nội bộ được phát triển cho một tổ chức. Tổ chức định cấu hình và uỷ quyền ứng dụng cho tất cả người dùng trong tổ chức của họ.
Ứng dụng bên thứ ba được phát triển cho người dùng/khách hàng bên ngoài (tức là nhà phát triển và người dùng thuộc các tổ chức khác nhau). Nhà phát triển định cấu hình ứng dụng nhưng tổ chức của người dùng sẽ uỷ quyền cho ứng dụng bên thứ ba.
Định cấu hình uỷ quyền trên toàn miền bằng Mã ứng dụng khách OAuth của ứng dụng và Phạm vi mà ứng dụng yêu cầu.
Đăng nhập vào Bảng điều khiển dành cho quản trị viên của Google rồi chuyển đến phần uỷ quyền trên toàn miền.
Trong API clients, hãy nhấp vào Thêm mới.
Nhập Client ID của ứng dụng để uỷ quyền (tức là ứng dụng sử dụng Looker Studio API).
Nhập tất cả các phạm vi OAuth mà ứng dụng yêu cầu. Các phạm vi sau đây thường được yêu cầu nếu bạn dùng API Looker Studio để quản lý tài sản:
https://www.googleapis.com/auth/datastudio
https://www.googleapis.com/auth/userinfo.profile
Nhấp vào Uỷ quyền.
Sau khi bạn uỷ quyền cho ứng dụng, mọi người dùng Workspace thuộc tổ chức sẽ tự động được uỷ quyền sử dụng ứng dụng bằng Looker Studio API.
3. Lấy mã truy cập OAuth 2.0 và gọi API
Sau khi phát triển và uỷ quyền ứng dụng, bạn sẽ có quyền truy cập cần thiết để gọi API cho người dùng Workspace. Hãy xem bài viết Sử dụng OAuth 2.0 để truy cập vào API Google để biết thông tin chi tiết về cách sử dụng OAuth với API Google. Hãy tham khảo tài liệu tham khảo về API để biết các thao tác có thể thực hiện.
Khắc phục sự cố
Thiếu hộp thoại OAuth
Nếu tổ chức của người dùng đã uỷ quyền cho ứng dụng, thì người dùng của tổ chức đó sẽ không thấy hộp thoại OAuth khi uỷ quyền cho ứng dụng. Trường hợp ngoại lệ duy nhất là nếu ứng dụng yêu cầu uỷ quyền cho các phạm vi API bổ sung của Google mà Quản trị viên Workspace chưa định cấu hình. Trong trường hợp đó, người dùng sẽ thấy hộp thoại OAuth.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 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."]]