新的谷歌Sheet API打破了从驱动器的下载。现在,如何下载整个工作表? [英] The new google sheets API broke downloading from drive. Now, how should one download an entire sheet?
问题描述
我以前使用此方法: http://stackoverflow.com/a/12507856/3772221
我将发送一个抓取到这个形式的URL,替换 $ {gid}
和 $ {id}
与工作表的id和和gid。
Where I would send a fetch to a URL in this form, replacing ${gid}
and ${id}
with the id and and gid of the sheet.
https://docs.google.com/spreadsheets/d/${id}/export?format=csv&gid=${gid}
但截至今天,它不再为我工作。在我去网上查找原因后,我看到google昨天更新了他们的电子表格API。
but as of today it's no longer working for me. After I went looking online for the reason, I saw that google updated their spreadsheet API yesterday.
我现在从下载一个特定的工作表电子表格是这样: https://developers.google .com / sheets / reference / rest / v4 / spreadsheets.values / get#http-request ,但是考虑到我不想要一个值范围,这个页面是没有帮助的。我只是想要下载文件作为csv,如果我点击下载链接。
The only thing that I've found now on downloading a specific worksheet from a spreadsheet is this: https://developers.google.com/sheets/reference/rest/v4/spreadsheets.values/get#http-request, but this page is pretty unhelpful considering that I don't want a value range. I just want want to download the file as a csv as if I clicked the download link.
有没有人知道一个类似于我之前使用的方法吗?我不想使用这个新的API,而是像以前一样下载文件本身。
Does anyone know a method similar to what I was using before? I don't want to use this new API, but rather download the file itself as I was doing before.
推荐答案
适用于我的网址格式如下:
The new URL that worked for me is in the form:
https://docs.google.com/spreadsheets/u/1/d/${id}/export?format=csv&id=${id}&gid=${gid}
这篇关于新的谷歌Sheet API打破了从驱动器的下载。现在,如何下载整个工作表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!