Google Drive SDK Mobile集成查询 [英] Google Drive SDK Mobile integration query

查看:96
本文介绍了Google Drive SDK Mobile集成查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在开发一个使用HTTP POST / GET来检索文件/文件夹,上传/下载文件等列表的移动应用程序,这似乎与GData文档列表API的工作正常。现在GDrive SDK V2已经可用了,我正在转向新的API。



当我从 https://docs.google.com/feeds/ https://www.googleapis.com/auth/drive ,我遇到了400错误。我知道我需要配置使用Google Drive SDK的API控制台。



这里,问题是在API控制台中配置Google Drive SDK时,它要求打开网址(该网址在用户使用您的应用程序打开现有Google云端硬盘项目时使用),这不适用于我的应用程序(这只是一个文件管理器应用程序)。



请让我知道如何解决此限制。



最好的问候,
Karthik



更新:



我遵循 https: //developers.google.com/accounts/docs/OAuth2ForDevices



发布网址: https://accounts.google.com/o/oauth2/device/code



POST正文:client_id = xxxxx.apps.googleusercontent.com& scope = https://www.googleapis.com/auth/drive



HTTP答案:400



回复正文:

{
错误:invalid_scope

如果我的POST Body如下所示:
client_id = xxxxx.apps.googleusercontent.com& scope = https:// docs。 google.com/feeds/

解决方案

如果您只想使用,则无需设置Open With和Create URL该API不与Drive用户界面集成。 Drive API应该能够替代您的文档列表集成。



请确保您使用的是API版本2,您的范围问题可能与使用v1相关。我们可以通过粘贴请求和响应来检查您收到400美元。


I have been developing a mobile app which uses HTTP POST/GET to retrieve the list of files/folders, upload/download files etc., which seems to work fine with GData Document List API's. Now that GDrive SDK V2 is available, I am moving to the new API's.

When I change the auth scope from https://docs.google.com/feeds/ to https://www.googleapis.com/auth/drive, I got a 400 error. I learnt that I need to configure the API console for using Google Drive SDK.

Here, the problem is while configuring the Google Drive SDK in API Console, it asks for Open URL (This URL is used when the user opens an existing Google Drive item with your application) which is not applicable for my app (this is only a file manager app).

Please let me know how can workaround this restriction.

Best regards, Karthik

Updates:

I am following instructions at https://developers.google.com/accounts/docs/OAuth2ForDevices

POST URL : https://accounts.google.com/o/oauth2/device/code

POST Body : client_id=xxxxx.apps.googleusercontent.com&scope=https://www.googleapis.com/auth/drive

HTTP Response : 400

Response Body :

{ "error" : "invalid_scope" }

If I have the POST Body as below it works client_id=xxxxx.apps.googleusercontent.com&scope=https://docs.google.com/feeds/

解决方案

You don't need to set up Open With and Create URLs if you just want to use the API without integrating with the Drive User Interface. The Drive API should work to replace your Documents List Integration.

Please make sure you are using v2 of the API, your scope issues could be related to using v1. We could check by pasting the request and response where you receive 400.

这篇关于Google Drive SDK Mobile集成查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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