英文:
How to edit/open Google Sheet using API?
问题
我使用 API 获取 access_token,现在我需要打开 Google 表格。
我将 "Authorization: Bearer ya29.a0AV...." 与链接一起发送:"https://docs.google.com/spreadsheets/u/0/d/[DocumentFileID]/edit",然后我收到一个大约 200KB 的 HTML 文档。我使用 libcurl 进行操作。
问题是,一些 CSS 和 JS 文件丢失了,我只能看到文档的部分内容。有没有办法使用 API 打开/编辑 Google 表格?
我知道有一个选项,就是在新的浏览器选项卡中打开 https://docs.google.com/spreadsheets/u/0/d/[DocumentFileID]/edit,但在这种情况下,我需要手动登录到 Google,这是我想避免的,因为我想使用 API 进行登录并打开/编辑表格。
我还知道有分享文档的选项,但我也想避免这种情况。我正在为那些确认了 API 使用的客户编写应用程序,他们可以在确认后访问自己的文档。
英文:
I'm using API to get access_token and now I need to open Google Sheet.
I'm sending "Authorization: Bearer ya29.a0AV...." together with link: "https://docs.google.com/spreadsheets/u/0/d/[DocumentFileID]/edit" and I get HTML document back (~200kb). I'm using libcurl for that.
The problem is - missing are some css and js files and I see document just partially. Is there any way to open/edit Google Sheet using API?
I know for the option to just open https://docs.google.com/spreadsheets/u/0/d/[DocumentFileID]/edit in the new browser tab, but in that case I need to manually login to Google and that's what I try to avoid, because I want to use API to login and to open/edit a Sheet.
I also know for the option to share a document but I also try to avoid that. I'm writing application to customers who can access they own documents once they confirmed API usage.
答案1
得分: 1
我认为你可能误解了Google Sheets API的功能。
Google Sheets API是一个RESTful接口,允许你读取和修改电子表格的数据。
它提供对数据的访问,但不允许你打开Google Sheets Web应用程序。如果你希望用户直接打开表格,你需要编写自己的类似Google Sheets的应用程序。
英文:
I think you may have misunderstood what the google sheets api can do
>The Google Sheets API is a RESTful interface that lets you read and modify a spreadsheet's data.
It gives you access to the data, it does not allow you to open the google sheets web application. Your going to have to code your own google sheets type app if you want users to open sheets directly.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论