未收到“webViewLink"作为回应? [英] Not receiving "webViewLink" in response?

查看:14
本文介绍了未收到“webViewLink"作为回应?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从管理控制台打开 Google Drive API 访问并获取我的客户端 ID 密钥后,我按照示例代码(使用 Python 2.7),我能够插入一个文件夹,设置适当的权限(type=anyone,role=reader),然后在新文件夹中插入一个 text/html 类型的文件.

After turning on Google Drive API access from the management console and getting my Client ID keys, I followed the sample code (using Python 2.7) and I am able to insert a folder, set the appropriate permissions (type=anyone,role=reader), and insert a text/html type file into the new folder.

但是,我在驱动器服务上执行插入时收到的 JSON 文件资源对象没有webViewLink"字段!有webContentLink"和selfLink"字段,但静态 HTML 发布所必需的webViewLink"似乎不见了.

However the JSON file resource objects I receive from executing insert on the drive service have no 'webViewLink' field! There are 'webContentLink' and 'selfLink' fields but 'webViewLink', which is necessary for static HTML publishing, seems to be missing.

最令人困惑.如果此功能尚未开启,或者如果我需要配置我的帐户设置以允许 HTML 发布,请告诉我.任何其他帮助将不胜感激;)

Most perplexing. If this feature hasn't been turned on yet or if I need to configure my account settings to allow HTML publishing please let me know. Any other help would be most appreciated ;)

推荐答案

webViewLink 属性仅针对公用文件夹返回,而不是此类文件夹中的单个文件.您可以使用它作为基本 url 来构建指向您的文件的链接.

The webViewLink property is only returned for public folders, and not the single files inside such folders. You can use that as the base url to construct links to your files.

这篇关于未收到“webViewLink"作为回应?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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