title: convert Google Docs to Docx using google script
body: <p>GoogleDoc is created and it logs changes, however, when i convert, i get a blank document docx. What am I doing wrong?</p>
  
  <pre><code>var doc_id = DocumentApp.create('Sample Document').getId();
  var doc = DocumentApp.openById(doc_id);
  var body = doc.getBody();
  var rowsData = [['Plants', 'Animals'], ['Ficus', 'Goat'], ['Basil', 'Cat']];
  body.insertParagraph(0,'test');
  table = body.appendTable(rowsData);
  var file = Drive.Files.get(fileId);
  var url = 'https://docs.google.com/feeds/download/documents/export/Export?id=' + fileId + '&amp;exportFormat=docx';
  var options = {
  headers: {
    Authorization: "Bearer " + ScriptApp.getOAuthToken()
  },
      muteHttpExceptions: true
  }
  var response = UrlFetchApp.fetch(url, options);
  var doc = response.getBlob();
  DriveApp.createFile(doc).setName(file.title);
  </code></pre>