title: Google Sheets API: How to "publish to web" for embeddable sheet?
body: <p>If I wanted to publish a Google Sheets spreadsheet so I could embed it on a page within an iframe, I would manually do the following:</p>
  
  <ol>
  <li>Navigate to Google Drive</li>
  <li>Open a spreadsheet</li>
  <li>File > Publish To Web > Embed > Copy the generated iframe link into an html file</li>
  </ol>
  
  <p>How would I programmatically achieve the above through the Google Sheets API using JavaScript on the front end? I'm generating spreadsheets on the fly in my application and want to immediately embed them on the page once created.</p>
  
  <p>Once the sheet is created, I can dynamically create an iframe element with the necessary attributes (the sheets ID, among others). That throws an error. From this <a href="https://stackoverflow.com/questions/14223675/set-publish-to-web-in-google-spreadsheet-using-drive-python-api">question</a>, it looks like a sheet needs to have a <code>published: true</code> attribute or something, but that requires using the Drive API - I'm trying to avoid that. Is this possible to handle <em>only</em> through the Sheets API?</p>