I am developing an app that should provide a Google Apps Admin the ability to reassign ownership on files. Currently I am using the Google Drive SDK for .NET with C# code.
When I authenticate in the Google Drive SDK test demo at https://developers.google.com/drive/v2/reference/permissions/insert and fill in the FileId
of a file belonging to the Admin and try to insert another owner from the same Google Apps domain I get a 500 internal server error. I'm using these values:
POST https://www.googleapis.com/drive/v2/files/0B1Y4_hVm0vbESlZuZHhBemtjcXM/permissions?key={YOUR_API_KEY}
Content-Type: application/json
Authorization: Bearer {MY_ACCESSTOKEN}
X-JavaScript-User-Agent: Google APIs Explorer
{
"role": "owner",
"type": "user",
"value": "user@mydomain.com"
}
The "Try It" demo sets me up with the scopes
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
to do this operation.
I am able to get a list of the permissions on the file by using the Try It demo authenticated as the same admin user, but I am unable to insert of delete owner permissions.
I picked the Google Drive SDK because it is newer and the Google Docs API was just depricated, but I would be willing to use whatever was the best tool for updating the ownership. I'm just looking for the straightest path to that goal.
Has anyone got the ownership update working? If so what tool did you use?