title: Create a Google Document with Google Drive API and Node.js
body: <p>I'm using Google Drive API V3 to manage my Google Drive with Node.js and google-api-nodejs-client v12.0.0 (<a href="http://google.github.io/google-api-nodejs-client/" rel="nofollow">http://google.github.io/google-api-nodejs-client/</a>)</p>
  
  <p>When I try to create a simple text/plain document, all work fine. But when I try to create a Google Document, Google Drive API return a 400 error with message "Bad Request".</p>
  
  <pre><code>/**
     * Create file on Google Drive
     * https://developers.google.com/drive/v3/reference/files/create
     */
    CreateFile: (googleapi, oauth2Client, fileName, fileContent, fileType) =&gt; {
      const DRIVE = googleapi.drive({ version: 'v3', auth: oauth2Client });
  
      return new Promise((resolve, reject) =&gt; {
        console.log('fileType:',fileType);
        DRIVE.files.create({
          resource: {
            name: fileName,
            mimeType: fileType
          },
          media: {
            mimeType: fileType,
            body: fileContent
          }
        }, (err, result) =&gt; {
          if( err ) {
            reject(err);
          }
          else {
            resolve(result);
          }
        });
      });
  </code></pre>
  
  <p>When the value of variable "fileType" is "text/plain", all is ok. But when  I put "application/vnd.google-apps.document" to the value, I got a 400 error.</p>
  
  <p>Some solution ? :)</p>