Publish Google Sheet document to the web using Google Sheets API

夙愿已清 提交于 2019-12-13 00:36:38

问题


My goal is to publish a Google Sheet document to the web and get the link using Google Sheets API.

I managed to publish it using this advice and now it says "published" in File -> Publish to the web tab. However, the link given on this tab is different from the original file id, and I don'k know how to get it with API.


回答1:


Unfortunately, the URL of https://docs.google.com/spreadsheets/d/e/### Not fileId ###/pubhtml retrieved when the spreadsheet is published cannot be directly retrieved. At Drive API v2, there was publishedLink in Revision as a field. But I confirmed that it cannot be used now. publishedLink was removed by updating Drive API from v2 to v3. This might affect to the situation. But I'm not sure about this.

So how about using the following URL as a workaround? In this case, you can access the published spreadsheet using file ID.

https://docs.google.com/spreadsheet/pub?key=### fileId ###

Reference :

  • Migrate to Google Drive API v3

If I misunderstand your question, I'm sorry.



来源:https://stackoverflow.com/questions/48573319/publish-google-sheet-document-to-the-web-using-google-sheets-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!