迁移到 Drive API v3
如果您目前使用的是 Drive API v2,则可以迁移到 v3。
您应查看 v2 到 v3 的参考文档,以便全面了解两个版本之间所有资源差异。
{drive_api_short} 版本的设置因语言而异:
var DISCOVERY_DOCS = ["https://www.googleapis.com/discovery/v1/apis/drive/v3/rest"];
service = build('drive', 'v3', credentials=creds)
- 对于 Node.js,您可以在设置 google.drive 构造函数时定义版本。如需查看示例,请参阅 Node.js 快速入门。
const drive = google.drive({version: 'v3', auth});
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-02-24。
[null,null,["最后更新时间 (UTC):2025-02-24。"],[[["Drive API users can migrate from v2 to v3 using the provided reference guide."],["The v3 implementation varies by language, with Java requiring a library download, JavaScript needing a Discovery docs URL, Python specifying during service object creation, and Node.js setting it in the google.drive constructor."]]],["Drive API v2 users can migrate to v3, consulting the provided reference for resource differences. Version specification varies by language: Java users download the v3 library; JavaScript users define the version via a Discovery docs URL. Python developers specify the version when building the service object, and Node.js developers define the version during the `google.drive` constructor. Each language has a quickstart for an example on the implementation.\n"]]