我们很高兴地宣布,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 或 Looker 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}端点返回 id 作为类型 string 而不是类型 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 更新到 v22.0 及更高版本;然后解决由此产生的类型错误(如有)
Kotlin SDK
无影响
您无需执行任何操作
LookR SDK
无影响
您无需执行任何操作
C# SDK
无影响
您无需执行任何操作
Go SDK
运行时异常
将 SDK 更新到 v22.0 及更高版本;然后解决由此产生的类型错误(如有)
其他
使用 4.0 API,但不使用 SDK(或使用外部提供的库)
可能会出现的运行时错误,具体取决于语言的类型敏感度
检查代码中是否存在对任何 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"]],["最后更新时间 (UTC):2025-09-11。"],[],[],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."]]