访问“知道链接的任何人”通过 API 的 Google 电子表格
尝试以下工作流程:
- 创建 Google 电子表格。将其 ACL 设置为“知道链接的任何人”
- 获取其密钥 (https://spreadsheets0.google.com/spreadsheet/ccc?key=HEREISTHEKEY)
- 尝试使用 HTTP API 访问它: https://spreadsheets.google.com/feeds/list/HEREISTHEKEY/o6d/public/full (也尝试使用 private 而不是 public )
- 收到 404 错误
似乎 Google Spreadsheet API 不允许在您不使用时从 API 访问私有链接经过身份验证,但也许我在某个地方错了。
这有点不合逻辑,因为从浏览器访问此电子表格时不需要登录。
有什么想法(我会填写错误报告)?
谢谢!
Try the following workflow:
- Create a Google Spreadsheet. Set its ACL to “Anyone with the link”
- Get its key (https://spreadsheets0.google.com/spreadsheet/ccc?key=HEREISTHEKEY)
- Try accessing it with the HTTP API: https://spreadsheets.google.com/feeds/list/HEREISTHEKEY/o6d/public/full (try with private instead of public also)
- Get a 404 error
It seems that the Google Spreadsheet API does not allow accessing a private link from the API when you are not authenticated, but maybe I'm wrong somewhere.
It's kind of illogical because you don't need to be logged in when accessing this spreadsheet from a browser.
Any thoughts (I'll fill up a bug report)?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一种想法(我不确定这是否适用于您的情况)是,您可以尝试构建一个虚拟的 Google 帐户,并让您的界面使用这些虚拟凭据访问 HTTP API。它很脏,但它可能会起作用,因为一旦您登录,您肯定应该经过身份验证。正确的?
One thought, and I'm not sure if this is applicable to your situation, is that you might try building a dummy Google account and having your interface access the HTTP API using those dummy credentials. It's dirty, but it might work, as once you're logged in you should definitely be authenticated. Right?
为了能够通过 API 访问它,您需要“发布”电子表格。您可以通过文件菜单执行此操作:
文件 > “发布到网络...”
然后您就可以通过 API 使用您提供的 URL 进行发布。我一开始也有这个问题!
To be able to access it via the API, you need to "publish" the spreadsheet. You can do this via the file menu:
File > "Publish to the web..."
You'll then be able it via the API with the URL you gave. I had this issue initially too!