创建项目
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
您必须先将客户端的信息告知 Google,并允许访问 Google Drive Activity API,然后才能向该 API 发送请求。为此,您可以使用 Google Cloud 控制台创建一个项目(该项目是设置和 API 访问信息的命名集合)。
设置环境
如需开始使用 Drive Activity API,您必须在 Google Cloud 控制台中创建项目、启用 API 并创建凭据。
创建项目
您必须有一个 Google Cloud 项目。
启用 API
在使用 Google API 之前,您需要先在 Google Cloud 项目中启用这些 API。您可以在单个 Google Cloud 项目中启用一个或多个 API。
创建凭据
您可以使用 OAuth 客户端 ID 或服务账号创建凭据。如需了解详情,请参阅创建访问凭据。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-03-26。
[null,null,["最后更新时间 (UTC):2025-03-26。"],[],[],null,["# Create a project\n\nBefore you can send requests to Google Drive Activity API, you must notify Google about\nyour client and allow access to the API. You do this by using the\nGoogle Cloud console to create a project, which is a named collection of settings\nand API access information.\n\nSet up your environment\n-----------------------\n\nTo get started using Drive Activity API, you must create a project in the\nGoogle Cloud console, enable the API, and create credentials.\n\n### Create your project\n\nYou must have a [Google Cloud\nproject](../../../../workspace/guides/create-project).\n\n### Enable the API\n\nBefore using Google APIs, you need to turn them on in a Google Cloud project. You can turn on one or more APIs in a single Google Cloud project.\n\n- In the Google Cloud console, enable the Google Drive Activity API.\n\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=driveactivity.googleapis.com)\n\n### Create the credentials\n\nYou can create credentials using either an OAuth client ID or a service account.\nFor more information, see [Create access\ncredentials](https://developers.google.com/workspace/guides/create-credentials)."]]