google-admin-sdk

Google Data Transfer API says completed but nothing has happened?


I'm using the Data Transfer API to programmatically transfer the files owned by user A to user B as part of our exit process.

I look up the email addresses for the two users so that I can retrieve their IDs. I also query the list of data transfer applications to get the application ID for "Drive and Docs".

I pass the built transfer definition to the API and get the following JSON back:

{
   "kind": "admin#datatransfer#DataTransfer",
   "etag": "\"RV_wOygBiIUZUtakV6Iq44-H_Gw/2M4Z2X_c8OpsyQOJxtWDmIHcYzo\"",
   "id": "AKrEtIbF0aAg_4KK7-lHFOpRNPhcgAOWWDEK1HE0zD_EEY-bOPHXuj1rKNrEE-yHPYyjY8vzvZkK",
   "oldOwnerUserId": "101496053770427062754",
   "newOwnerUserId": "118268322014081744703",
   "applicationDataTransfers": [
      {
         "applicationId": "55656082996",
         "applicationTransferStatus": "pending"
      }
   ],
   "overallTransferStatusCode": "inProgress",
   "requestTime": "2017-03-31T10:50:48.560Z"
}

I then query the transfers API to get an update on that transfer and get the following back:

{
   'kind': 'admin#datatransfer#DataTransfer',
   'requestTime': '2017-03-31T10:50:48.560Z',
   'applicationDataTransfers': [
      {
         'applicationTransferStatus': 'completed',
         'applicationId': '55656082996'
      }
   ],
   'newOwnerUserId': '118268322014081744703',
   'oldOwnerUserId': '101496053770427062754',
   'etag': '"RV_wOygBiIUZUtakV6Iq44-H_Gw/ZVnLgj3YLcsURTSzNm8m91tNeC0"',
   'overallTransferStatusCode': 'completed',
   'id': 'AKrEtIbF0aAg_4KK7-lHFOpRNPhcgAOWWDEK1HE0zD_EEY-bOPHXuj1rKNrEE-yHPYyjY8vzvZkK'
}

and, indeed, I get a confirmation email that the files have been transferred.

However, if I look in Google Drive for both users, the files have NOT changed ownership. For user B, a new directory has been created with the email address of user A, but it contains no files and user A still owns all of their files.

What have I done wrong or misunderstood?

Thanks.


Solution

  • I had faced the same issue, please provide "applicationTransferParams" with key value.

      "applicationTransferParams": [
        {
          "key": string,
          "value": [
            string
          ]
        }
      ]