進階雲端硬碟標籤服務
您可以使用 Google 雲端硬碟標籤進階服務,為雲端硬碟檔案和資料夾建立及管理標籤。有了這項進階服務,您就能在 Apps Script 中使用 Drive Labels API 的所有功能。
如要套用或移除雲端硬碟標籤,請使用進階雲端硬碟服務。
參考資料
如要進一步瞭解這項服務,請參閱 Google Drive Labels API 說明文件。如同 Apps Script 中的所有進階服務,Drive 標籤 API 服務會使用與公用 API 相同的物件、方法和參數。
如要回報問題或尋求其他支援,請參閱 Google Drive Labels API 支援指南。
程式碼範例
以下程式碼範例使用 API 的 第 2 版。
列出標籤
下列程式碼範例說明如何取得使用者可用於提出要求的標籤清單。
取得標籤
以下程式碼範例說明如何根據資源名稱 (也就是標籤的字串值) 取得單一標籤。如要找出標籤名稱,請透過 API 取得標籤清單,或使用 Drive 標籤管理工具。如要進一步瞭解標籤管理工具,請參閱「管理雲端硬碟標籤」。
列出雲端硬碟項目的標籤
以下程式碼範例示範如何取得 Google 雲端硬碟項目,並列出套用至該項目的所有標籤。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-12-21 (世界標準時間)。
[null,null,["上次更新時間:2024-12-21 (世界標準時間)。"],[[["Utilize the Google Drive Labels advanced service in Apps Script to create and manage labels for your Google Drive files and folders, leveraging the Drive Labels API."],["To use this advanced service, ensure you enable the Advanced Drive Service in your Apps Script project settings before implementation."],["Access comprehensive documentation and support resources for the Google Drive Labels API, which uses the same structure as the public API, in the provided references."],["Explore the provided sample code snippets to learn how to list available labels, retrieve specific labels by name, and list labels applied to Drive items using Apps Script."]]],[]]