Google Drive API Upload to Parent Folder
<p>I have a JavaScript based Google Apps script that iterates through all files in Drive and converts MS files to Google format. I am using Drive API to upload and convert. Everything seems to work fine, except when I have a file in a Drive sub folder. When the file is uploaded back to Drive, I cannot define a parent folder, so it goes directly to the root.  </p>

<p>I have a handle on the parent folder ID, but when I add "parents : folderID" to the JSON String, I do not see any change in the upload path. </p>

<p>This is my upload and convert function, is there any way to modify this to define a parent folder? I'm totally lost with the API... Can anyone assist?</p>

<pre><code> var uploadFile = JSON.parse(
 UrlFetchApp.fetch("https://www.googleapis.com/upload/drive/v2/files?uploadType=media&amp;convert=true", 
 {
   method: "POST",
   contentType: officeFile.getMimeType(),
   payload: officeFile.getBlob().getBytes(),
   parents: ['id' : folderID], &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; this line
   headers: {
     "Authorization" : "Bearer " + ScriptApp.getOAuthToken()
   },
   muteHttpExceptions: true
 }).getContentText());
</code></pre>