You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Google API Data Transfer Insert(Drive)显示完成但未实际转移所有权问题咨询

Troubleshooting Google Drive Ownership Transfer via Data Transfer Insert API

I’ve run into similar head-scratching edge cases with Drive transfers before—super frustrating when the API reports success but nothing actually moves, especially since your Calendar logic works flawlessly. Let’s break down the most likely fixes and checks to get this sorted:

1. Fix the applicationDataTransfer Structure for Drive

Unlike Calendar, Drive demands explicit parameters in your request body to trigger an actual ownership transfer. The most common oversight here is omitting the critical applicationTransferParams that tell the API exactly what content to move.

Here’s the mandatory structure you need for Drive transfers:

{
  "oldOwnerUserId": "old-user@your-domain.com",
  "newOwnerUserId": "new-user@your-domain.com",
  "applicationDataTransfers": [
    {
      "applicationId": "225428255943", // Official Google Drive application ID
      "applicationTransferParams": [
        {
          "key": "TRANSFER_ALL",
          "value": "true"
        }
      ]
    }
  ]
}

Calendar might work with just the applicationId field, but Drive needs that TRANSFER_ALL flag to initiate a full ownership handoff. Without it, the API will return a success status but won’t process any files at all.

2. Dig Into the Full API Response Details

Don’t just stop at the top-level "success" message—parse the entire response payload to spot hidden issues:

  • Check the transferStatus field for each Drive entry in applicationDataTransfers; a PARTIAL_SUCCESS means some files failed to transfer (e.g., deleted files, files with restricted sharing settings).
  • Look for hidden errors objects that might reveal root causes: the new user’s Drive is full, the old user has no Drive content to transfer, or specific files are owned by external accounts that can’t be transferred.

3. Verify User and Drive State

  • Old User: Confirm they actually have Drive content to transfer. If their Drive is empty, the API will report success with nothing to move—obvious, but easy to overlook.
  • New User: Check if their Drive has enough storage space. If it’s full, transfers will silently fail even if the API says it worked. Also, don’t forget to check their "Shared with me" folder—sometimes transferred files land there instead of "My Drive" by default.

4. Double-Check Permissions (Even if You Think They’re Correct)

  • Ensure your service account has Domain-Wide Delegation enabled, with these required scopes:
    • https://www.googleapis.com/auth/admin.datatransfer (for the Data Transfer API itself)
    • https://www.googleapis.com/auth/drive (to access and modify Drive ownership)
  • Verify the admin account you’re impersonating has the Super Admin role—standard admin roles often lack the permissions to transfer Drive ownership across users.

5. Test with a Small, Targeted Dataset

Try transferring a single test file first (instead of all Drive content) to narrow down the issue. Use the FILE_IDS parameter in applicationTransferParams to target specific files:

"applicationTransferParams": [
  {
    "key": "FILE_IDS",
    "value": ["123abcXYZ..."] // Replace with your test file ID
  }
]

If this works, the problem might be with specific files in the old user’s Drive (e.g., corrupted files, files owned by external users) that are blocking a full transfer.

内容的提问来源于stack exchange,提问作者Ben R.

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 09:53:37