遷移至 Drive API v3
如果您目前使用 Drive API 第 2 版,可以改用第 3 版。
請參閱從 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});
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-02-24 (世界標準時間)。
[null,null,["上次更新時間: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"]]