准备使用 People API
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
在开始编写您的首个客户端应用之前,您需要完成以下三项准备工作:
- 获取 Google 账号
- 创建项目
- 设置应用
如果您尚未完成这些任务,本指南将引导您完成这些任务。
1. 获取 Google 账号
您需要拥有一个 Google 账号才能在 Google API 控制台中创建项目。如果您已经拥有账号,则无需进行任何操作。您可能还需要一个用来测试的单独 Google 账号。
2. 为客户端创建一个项目
在向 People API 发送请求之前,您需要告知 Google 您的客户端并激活对该 API 的访问权限。为此,您可以使用 Google API 控制台创建一个项目(该项目是设置和 API 访问信息的命名集合),然后注册您的应用。
开始使用 People API 之前,您需要先使用设置工具在 Google API 控制台中创建项目并启用该 API。
3. 设置应用
如果您使用的是支持的语言之一,请考虑使用客户端库。您必须先设置授权,然后才能向 API 发出请求。
请查看快速入门示例代码,其中展示了如何以各种语言获取联系人列表。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-12-18。
[[["易于理解","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"]],["最后更新时间 (UTC):2025-12-18。"],[],["To start coding, you must first obtain a Google Account. Then, use the Google API Console to create a project, which involves registering your application and enabling API access via the setup tool. Finally, set up your application, potentially using a client library and ensuring proper authorization before making API requests. Sample code is available to demonstrate fetching a list of contacts in various languages.\n"]]