title: Transfer file ownership with google drive API
body: <p>I am trying to create a Java application to manage user accounts on Google Apps. One of the requirements is to transfer all the files owned by a user before I delete that user.</p>
  
  <p>I am using Google Drive API to insert a file permission on the file being transferred:</p>
  
  <p>POST <a href="https://www.googleapis.com/drive/v2/files/" rel="nofollow">https://www.googleapis.com/drive/v2/files/</a>{fileId}/permissions
  {
    "role":"owner"
    "type":"user"
    "value":"transferuser@domain.com"
  }</p>
  
  <p>I received the HTTP 500 "Internal Error".</p>
  
  <p>I am using the OAuth 2.0 to authenticate to Google Apps and my service account impersonates an admin user with all the administrative roles available on Google Apps.</p>
  
  <p>It seems that the only thing I could not do is to change the file ownership of the files that are not owned by the admin user. </p>
  
  <p>Anyone has an idea how to get this work.</p>
  
  <p>Thanks
  JP </p>