Google Drive API:如何获得指向Google文档的可共享链接? (alternateLink,webViewLink返回null) [英] Google Drive API: How to get a sharable link to Google docs? (alternateLink, webViewLink return null)

查看:98
本文介绍了Google Drive API:如何获得指向Google文档的可共享链接? (alternateLink,webViewLink返回null)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我引用了此帖子此发布,对于如何获取指向Google Doc的链接仍然一无所知. /p>

根据正式文档 webViewLink是在相关的Google编辑器或浏览器的浏览器中打开文件的链接".但是,它仅返回null,而其他属性(例如id或mimeType)则返回期望值. (webContentLink也会返回null.)

我可以简单地使用该URL,https://drive.google.com/open?FILE_ID_HERE,但是我不确定它是否可以在其他人的浏览器中使用.

我将不胜感激!

解决方案

如果知道Google文档的文件ID,则可以使用以下URL在浏览器中访问文件.

https://drive.google.com/open?id=FILE_ID

与您共享文件的任何人都可以访问该链接.

I referred to this posting and this posting, still clueless as to how to get a link to a Google Doc.

According to the offical document, webViewLink is "A link for opening the file in a relevant Google editor or viewer in a browser". However, it doesn't return anything but null, while other properties, such as id or mimeType, return expected values. (webContentLink returns null too.)

I could simply use this URL, https://drive.google.com/open?FILE_ID_HERE, but I'm not sure this works in other people's browser.

I'd appreciate any advice!

解决方案

If you know the file ID of a Google Document, you can use the following URL to access the file in the browser.

https://drive.google.com/open?id=FILE_ID

The link will be accessible to anyone with whom you have shared the file.

这篇关于Google Drive API:如何获得指向Google文档的可共享链接? (alternateLink,webViewLink返回null)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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