Method: parents.delete

從檔案中移除父項。

HTTP 要求

DELETE https://www.googleapis.com/drive/v2/files/{fileId}/parents/{parentId}

這個網址使用 gRPC 轉碼語法。

路徑參數

參數
fileId

string

檔案的 ID。

parentId

string

父項的 ID。

查詢參數

參數
enforceSingleParent
(deprecated)

boolean

已淘汰:如果項目不在共用雲端硬碟中,且最後一個父項已移除,則該項目會置於擁有者的根目錄下。

要求主體

要求主體必須為空白。

回應主體

如果成功,回應主體會是空的 JSON 物件。

授權範圍

需要下列其中一種 OAuth 範圍:

  • https://www.googleapis.com/auth/docs
  • https://www.googleapis.com/auth/drive
  • https://www.googleapis.com/auth/drive.file

部分權限受限制,應用程式必須通過安全性評估才能使用。詳情請參閱授權指南