GAPI(Google API)驱动器.具有属性"appProperties"的文件请求;不起作用 [英] GAPI (Google API) Drive. File request with attribute "appProperties" does not work

查看:56
本文介绍了GAPI(Google API)驱动器.具有属性"appProperties"的文件请求;不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请求参数:

"q": "appProperties has {key = 'hah' and value = 'vah'}",
"fields": "files (id, name, appProperties)"

通过在Google API基座环境(即Try it)中尝试files.list请求,请求将通过,并且数据将正确返回.

By trying the files.list request in the environment of the Google API docks (which is Try it), the request passes and the data is returned correct.

尝试从应用程序执行相同的请求,请求通过了,但是我得到了一个空文件列表

Trying to execute the same request from the application, the request passes, but I get an empty list of files

{
 "kind": "drive # fileList",
 "incompleteSearch": false,
 "files": []
}

是的,还有"incompleteSearch" 标头:false,但是在其他查询中,即使有这样的标头,数据也可以正确输入(也许您应该使用nextPageToken?).而且,如果通过GAPI发出相同的请求(而不是通过HTTP,XHR请求),则将出现一个空文件列表.

Yes, the "incompleteSearch" header also comes: false, but in other queries, even with such a header, the data comes in correctly (maybe you should use nextPageToken?). Moreover, if the same request is made via GAPI (and not via an HTTP, XHR request), then an empty list of files will simply come.

其他查询没有问题.授予所有权利(暂时用于测试).其他要求是正确的.该请求是直接从浏览器发出的.

There are no problems with other queries. All rights are granted (for the time being for the test). Other requests are correct. The request is made directly from the browser.

推荐答案

这很简单. appPropperties 是一个私有字段,并且只能在添加该应用程序的应用程序中使用.

It's very simple. appPropperties is a private field and is available only to the application that added it.

在这种情况下,Google API文档是一个应用程序,而我的是另一个应用程序.

In this case, Google API Doc was one application, and mine was another.

因此,我无法获得所需的数据,因为我不认为Google的扩展坞被认为是另一个应用程序(尽管这是合乎逻辑的).实现创建/更新文件时从应用程序添加这些属性的功能-一切正常.

Therefore, I could not get the data that was needed, because I did not think that Google’s docks are considered to be another application (although this is logical). Implementing the function to add these attributes from the application when creating/update a file - everything worked.

这篇关于GAPI(Google API)驱动器.具有属性"appProperties"的文件请求;不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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