3

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?

dflorey
  • 1,766
  • 2
  • 16
  • 29
  • 1
    Check http://stackoverflow.com/a/11415443/186674 for the list of Google Docs MIME types. – Claudio Cherubino Aug 03 '12 at 16:03
  • Possible duplicate of [Creating empty spreadsheets in Google Drive using Drive API (in Python)](http://stackoverflow.com/questions/12741303/creating-empty-spreadsheets-in-google-drive-using-drive-api-in-python) – wescpy Jul 15 '16 at 23:44

1 Answers1

5

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'
}
Steve Bazyl
  • 9,467
  • 3
  • 19
  • 24
  • 4
    Thanks! I had to add 'Content-Type: application/json' http header in the request. Otherwise I got '400 Bad Request - parse error'. – Takashi Oguma Oct 07 '13 at 14:52