很高興在此宣布,Looker API 4.0 現已在 Looker 22.4 中正式推出。一般可用的 API 4.0 (API 4.0 GA) 包含多項重大變更和附加變更,並將多個端點從 Beta 版升級為穩定版。如需詳細的 API 4.0 規格,請參閱 API 參考資料。我們更新了 Looker 支援和社群支援的 SDK,以支援 Looker API 4.0 GA 端點。詳情請參閱「API 和 SDK 支援政策」和「API 版本管理」。本文其餘部分將概述遷移至 API 4.0 GA 時,您可以期待的破壞性變更、因應措施和功能。
適用對象
如果您是透過 Looker 支援的 SDK、社群支援的 SDK 或 API 本身使用 Looker API,請參閱本文。請參閱以下對應您使用的 Looker API 版本的部分。
正式發布前 API 4.0 使用者
如果您使用的是 API 4.0,請參閱本節。這篇文章將說明遷移至 API 4.0 GA 時的破壞性變更和可用的緩解措施。
API 4.0 GA 會將所有實體 ID 欄位從數值 integer 類型變更為 string 類型。舉例來說,GET /groups/{group_id}端點會以 string 類型傳回 id,而非 int64 類型。
請參閱下表,瞭解 API 4.0 端點用途的影響和緩解措施:
用量
可能的影響1
預防
Looker 行動應用程式
Looker 行動應用程式的舊版安裝作業會停止運作
請使用者更新至最新版本的 Looker 行動應用程式
Looker 支援的 2 個 SDK
TypeScript SDK (4.0 API)
沒有影響
無須採取行動
Python SDK (4.0 API)
沒有影響
無須採取行動
Ruby SDK (4.0 API)
沒有影響
無須採取行動
社群支援的 2 個 SDK
Swift SDK
執行階段例外狀況
將 SDK 更新至 22.0 以上版本,然後解決產生的類型錯誤 (如有)
Kotlin SDK
沒有影響
無須採取行動
LookR SDK
沒有影響
無須採取行動
C# SDK
沒有影響
無須採取行動
Go SDK
執行階段例外狀況
將 SDK 更新至 22.0 以上版本,然後解決產生的類型錯誤 (如有)
其他
不使用 SDK (或使用外部提供的程式庫) 使用 4.0 API
可能發生的執行階段錯誤 (視語言的型別敏感度而定)
請檢查程式碼是否依賴任何 ID 欄位的類型,並新增對字串類型 ID 欄位的支援。另請參閱這份額外指南。
1:假設常見的使用模式可能會使用 Looker 的 ID 欄位,但不會使用不尋常的使用模式,例如將數值運算套用至 ID。
您可以期待 API 4.0 新增的新功能和附加變更,並隨時在 API 參考資料中查看最新變更。詳情請參閱「API 和 SDK 支援政策」和「API 版本管理」。我們瞭解破壞性變更並非理想做法。除非發生極端問題,否則我們不會對正式發布版 API 4.0 進行任何重大變更。我們希望 Looker API 4.0 正式版能協助您在 Looker 平台上更有效率、更輕鬆地進行開發。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[],[],null,["# Looker API 4.0 Generally Available\n\nWe are excited to announce that Looker API 4.0 is generally available in Looker 22.4. The generally available API 4.0 (API 4.0 GA) has multiple breaking and additive changes and promotes multiple endpoints from Beta to Stable. Check out our [API reference](/looker/docs/reference/looker-api/latest) for detailed API 4.0 specs. We updated our Looker-supported and Community-supported SDKs to support Looker API 4.0 GA endpoints. For more information, see [API and SDK support policies](/looker/docs/api-sdk-support-policy) and [API Versioning](/looker/docs/api-versioning). The rest of this article outlines the breaking changes, mitigations, and features you can look forward to when migrating to API 4.0 GA.\n\nWho should read this?\n---------------------\n\nThis document is for you if you use the Looker API through Looker-supported SDKs, Community-supported SDKs, or the API itself. Read the following section that maps to the Looker API version you use.\n\nPre-GA API 4.0 Users\n--------------------\n\nIf you use API 4.0, read this section. It covers the breaking changes and available mitigations when you migrate to API 4.0 GA.\n\nAPI 4.0 GA includes changing all entity ID fields from numeric `integer` type to `string` type. For example, `GET /groups/{group_id}` [endpoint](/looker/docs/reference/looker-api/latest/methods/Group/group) returns `id` as type `string` instead of type `int64`.\n\nPlease read through the following table for impact and mitigations specific to your API 4.0 endpoint usage:\n\n1: Assuming common usage patterns that may include the use of Looker's ID fields, but not unusual usage patterns such as applying numeric operations to IDs.\n\n2: [Looker API \\& SDK support](/looker/docs/api-sdk-support-policy). Community-supported libraries are not officially supported by Looker.\n\nAPI 3.1 Users\n-------------\n\nIf you use API 3.1, read this section. It covers the additional features and changes that API 4.0 makes available to you. Keep in mind, all our Looker-supported and Community-supported SDKs mainly support API 4.0. See [SDK and API support policies](/looker/docs/api-sdk-support-policy) for more information.\n\n### Additional API 4.0 GA Features\n\nFor convenience, we list the most notable and useful additive API 4.0 changes for you:\n\n- [Board, board item, and board section creation and management](/looker/docs/reference/looker-api/latest/methods/Board). See the [Board documentation page](/looker/docs/presenting-content) for more information about boards.\n- Query additional connection info such as [databases](/looker/docs/reference/looker-api/latest/methods/Metadata/connection_databases), [schemas](/looker/docs/reference/looker-api/latest/methods/Metadata/connection_schemas), [columns](/looker/docs/reference/looker-api/latest/methods/Metadata/connection_columns), and [tables](/looker/docs/reference/looker-api/latest/methods/Metadata/connection_tables). Set and update additional connection fields.\n- OAuth apps and users creation and management. See the [OAuth documentation page](/looker/docs/api-cors) for more information about OAuth.\n- Search groups with [hierarchy](/looker/docs/reference/looker-api/latest/methods/Group/search_groups_with_hierarchy) and [roles](/looker/docs/reference/looker-api/latest/methods/Group/search_groups_with_roles).\n- [Search roles with user count](/looker/docs/reference/looker-api/latest/methods/Role/search_roles_with_user_count).\n- [Get](/looker/docs/reference/looker-api/latest/methods/Config/get_setting) and [set](/looker/docs/reference/looker-api/latest/methods/Config/set_setting) Looker instance settings. See the [Settings documentation page](/looker/docs/admin-panel-general-settings) for more information about settings.\n- [Alert creation and management](/looker/docs/reference/looker-api/latest/methods/Alert). See the [Alerts documentation page](/looker/docs/alerts-overview) for more information about alerts.\n- [SSH tunnels and SSH servers creation, management, and testing](/looker/docs/reference/looker-api/latest/methods/Connection). See the [SSH documentation page](/looker/docs/using-an-ssh-tunnel) for more information about SSH.\n- [Move](/looker/docs/reference/looker-api/latest/methods/Dashboard/move_dashboard) and [copy](/looker/docs/reference/looker-api/latest/methods/Dashboard/copy_dashboard) dashboards.\n- [Get relative URLs for new dashboards](/looker/docs/reference/looker-api/latest/methods/Dashboard/create_dashboard).\n- [Move](/looker/docs/reference/looker-api/latest/methods/Look/move_look) and [copy](/looker/docs/reference/looker-api/latest/methods/Look/copy_look) Looks.\n- [Signed embed](/looker/docs/single-sign-on-embedding) and non-signed embed secret, URL, and user creation and management.\n- [Get refresh token to refresh login access token](/looker/docs/reference/looker-api/latest/methods/ApiAuth/login).\n- Limit and offset the results from getting [all LookML models](/looker/docs/reference/looker-api/latest/methods/LookmlModel/all_lookml_models) and [all users](/looker/docs/reference/looker-api/latest/methods/User/all_users).\n- Limit and offset the results from [searching users](/looker/docs/reference/looker-api/latest/methods/User/search_users).\n- [Get the Looker instance API spec in Swagger 2.x JSON](/looker/docs/reference/looker-api/latest/methods/Config/api_spec).\n\n### API 4.0 GA Deprecation Changes\n\nAPI 4.0 GA replaces several deprecated API 3.1 endpoints with improved features. The following endpoints are affected:\n\n- Deprecated Homepage endpoints have been removed. Please make use of [board endpoints](/looker/docs/reference/looker-api/latest/methods/Board) instead of homepages. See [Presenting content with boards](/looker/docs/presenting-content).\n- Deprecated Space endpoints have been removed. Make use of [folder endpoints](/looker/docs/reference/looker-api/latest/methods/Folder) instead of Space. See [Organizing and managing access to content](/looker/docs/organizing-spaces).\n\nAPI 3.0 Users\n-------------\n\nAPI 3.0 is [deprecated](/looker/docs/api-3x-deprecation), and it is recommended you migrate to API 4.0.\n\n- Only API 4.0 supports all Looker-supported and Community-supported SDKs to ease your development. Check out our [SDK repository](https://github.com/looker-open-source/sdk-codegen).\n- API 4.0 introduces multiple new features and enhancements as listed in the [Additional API 4.0 GA Features section](#additional_api_40_ga_features) on this page.\n\nWrap-Up\n-------\n\nYou can look forward to new features and additive changes to be added to API 4.0 and you can always find the latest changes in our [API reference](/looker/docs/reference/looker-api/latest). For more information, see [API and SDK support policies](/looker/docs/api-sdk-support-policy) and [API Versioning](/looker/docs/api-versioning). We know that breaking changes are not ideal. Unless an extreme issue arises, we will not make any breaking changes to our generally available API 4.0. We hope our generally available Looker API 4.0 helps you develop more productively and easily on the Looker platform."]]