Reputation: 100
I'm using the R httr package and the Google Drive API. Is there anything in the Google Drive API to set the fileId
of a file?
The scenario is: I have a Tableau report that is looking at a Google Sheet. I can't stream new data into the sheet from R because it's too heavy on the API and I get HTTP errors even with long sleep times. I can't upload a new file because the automation would break; Tableau hooks into a file through its unique ID.
Any way I can get around this?
Upvotes: 0
Views: 47
Reputation: 22306
Easy peasy lemon squeezy.
In Google Drive, the "file" (the thing with the ID) is a separate entity from that file's "content". So it's very simple to completely replace the content of an existing file without creating a new file. See https://developers.google.com/drive/v3/reference/files/update . If the files are large, make sure you use the resumable upload
form of the API as described here https://developers.google.com/drive/v3/web/manage-uploads#resumable
Upvotes: 0
Reputation: 117006
File id is set by google drive when you insert the file. Its not something you can supply.
The closes thing is in v3 which has something called genreatedids but this again is an ID created for you by Google its not one you can supply.
I can think of no work around for your problem.
Upvotes: 1