- Open Spreadsheet you want to allow access to
- Go to
Tools -> Script Editor - Enable google sheets api:
- Open in the menu
Resources / Advanced Google Services ... - Find
Google Sheetsin the list and enable it - Finish the dialog
- Open in the menu
- In
Script Editormake sureView -> Show manifest fileis checked - Make sure
appscript.jsonfile looks like our./appscript.json - Make sure
Code.gsfile looks like our./code.gs - Publish script by opening
Publish -> Deploy as web app- Set
Project versiontoNew - Set
Execute the app astoMe - Set
Who has access to the apptoAnyone, even anonymous - Hit
Update - (On first try) You have to
Review permissionsandAllowpermissions. Follow on screen instructions.
- Set
- You will get an URL - like:
https://script.google.com/macros/s/xxxxx-yyyyy/exec - Use this with query param
?sheet=header, whereheaderis Sheet Tab name (do not use spaces in Tab names)
Example:
https://script.google.com/macros/s/xxxxx-yyyyy/exec?sheet=Sheet1
-- many thanx to @gabor
And for those that need a
curlexample:URL looks like this:
https://docs.google.com/spreadsheets/d/${my_key}/export?format=csv&usp=sharingWorking Example:
https://docs.google.com/spreadsheets/d/1KdNsc63pk0QRerWDPcIL9cMnGQlG-9Ue9Jlf0PAAA34/export?format=csv&usp=sharing
curl looks like this:
curl -fsSL "https://docs.google.com/spreadsheets/d/${my_key}/export?format=csv&usp=sharing"Working Example:
curl -fsSL "https://docs.google.com/spreadsheets/d/1KdNsc63pk0QRerWDPcIL9cMnGQlG-9Ue9Jlf0PAAA34/export?format=csv&usp=sharing"Key is taken from the "Anyone with a link can access" link (like https://docs.google.com/spreadsheets/d/1KdNsc63pk0QRerWDPcIL9cMnGQlG-9Ue9Jlf0PAAA34/edit?usp=sharing)
Re: https://gist.github.com/dhlavaty/6121814#gistcomment-3930810