I am trying to transfer a Google Doc that currently belongs to me and move it to the root of another user's Google Drive. Both account are in the same domain and I'm using a Service Account to access all users.
At first I tried doing this by modifying the permissions. This would give the second user access to the file but it would not place it into the root of their drive or anywhere else. If the user wanted to see it they would have to do a search.
I then found some information that mentioned using the patch method of the files service to change the metadata of the file and thus initiate the transfer, but this hasn't worked.
The only thing I have for certain are the ID's of the root folders belonging to myself and the user I want to transfer the files to. Here's what I tried to do but failed.
# Note: "service" is the connection to the domain service account
service.files().patch(fileId='FILE_ID_GOES_HERE',
body={'parents':[{'isRoot':True,'kind':'drive#parentReference','id':'user_two_root_folder_id'}]},
removeParents=['user_one_root_folder_id'],
addParents=['user_two_root_folder_id'])
I can't tell if anything is wrong because I'm not getting any error messages.
Any ideas as to how to go about this would be greatly appreciated.