What is the best way to create an empty Google doc / spreadsheet? I am using the GData docs / spreadsheet api right now but I'd prefer to use the Drive API. Is there a mimetype that will create an empty Google Doc/Google Spreadsheet?
-
1Check stackoverflow.com/a/11415443/186674 for the list of Google Docs MIME types.Claudio Cherubino– Claudio Cherubino2012-08-03 16:03:58 +00:00Commented Aug 3, 2012 at 16:03
-
Possible duplicate of Creating empty spreadsheets in Google Drive using Drive API (in Python)wescpy– wescpy2016-07-15 23:44:27 +00:00Commented Jul 15, 2016 at 23:44
Add a comment
|
1 Answer
As Claudio mentioned in the comment, you can see the list of the supported MIME types in the other question. In practice, its very easy to create a blank doc. For example:
POST https://www.googleapis.com/drive/v2/files
{
'title' : 'My new document',
'mimeType':'application/vnd.google-apps.document'
}
1 Comment
Takashi Oguma
Thanks! I had to add 'Content-Type: application/json' http header in the request. Otherwise I got '400 Bad Request - parse error'.