title: How to create a shareable GSheet and get the URL?
body: <p>Inside a google apps script, you can do </p>
  
  <pre><code>//create spreadsheet
      var ss = SpreadsheetApp.create("Testing");
  
      //get public url
      var id = ss.getId()
      var file = DriveApp.getFileById(id);
      file.setSharing(DriveApp.Access.ANYONE_WITH_LINK, DriveApp.Permission.EDIT);
  </code></pre>
  
  <p>When I run that code, it just gives error:</p>
  
  <pre><code>We're sorry, a server error occurred.
  </code></pre>