我可以在没有OAuth同意屏幕的情况下通过Google Docs API下载Google文档吗? [英] Can I download a Google Document, via the Google Docs API without an OAuth consent screen?

查看:62
本文介绍了我可以在没有OAuth同意屏幕的情况下通过Google Docs API下载Google文档吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于这个问题,我已经遍历了几个循环,遍历了不赞成使用的文档和过时的Stackoverflow帖子.

I've been going in a few loops through deprecated documentation and outdated Stackoverflow posts on this problem.

我要实现的目标:用户为我的系统提供了可共享的链接(URL中带有 _usp = sharing _ 的链接).当我的系统具有此功能时,它将通过Google Docs API下载文档.我不希望用户必须经过授权屏幕,因为我希望我的应用程序仅看到单个共享文档的网址

What I want to achieve: User provides my system the Shareable link (The one with _usp=sharing_ within the URL). When my system has this, it downloads the document via the Google Docs API. I don't want the user to have to go through an authorization screen because I want my application to only see the single shared document URL

具体来说,我想要 Google Docs API的结果get 函数,以原始格式提供文档,结构和所有.

Specifically, I want the results of the Google Docs API get function, which provides the document in its raw form, structure and all.

Google Docs API建议我可以使用API​​密钥授权 但我没有成功.API抱怨我的请求缺少凭据.最简单形式的呼叫如下所示:

The Google Docs API suggests I can authorize using an API key but I have not been successful. The API complains that my request is missing credentials. The call in its simplest form looks something like so:

service = build('docs', 'v1', developerKey={key from dashboard})
query = service.documents.get(documentId={my doc id from shared url})
response = query.execute()

其他帖子也提到了Google Drive API及其导出功能,但这提供了

Other posts have pointed to the Google Drive API and its export function but this provides rendered formats rather than that pure JSON output I'm looking for.

希望以前曾对Google Docs API投入思想的人可以帮助解决这个问题:)

Hoping someone who's bashed their head against the Google Docs API previously can help with this one :)

推荐答案

我相信您的目标如下.

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆