Google Drive API访问令牌和重定向网址问题 [英] Google Drive API access token and redirect url questions

查看:235
本文介绍了Google Drive API访问令牌和重定向网址问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1 - 可以使用始终相同的访问令牌来运行文件上传/下载到Google云端硬盘API,这是我所有网站用户的共享主机,他们可以直接上传和下载文件?如果是的话该怎么做?在php客户端创建/授权中只使用静态访问令牌变量?

2 - 为什么我在谷歌api控制台上设置了我的web应用程序项目,并启用Gdrive api告诉我,我的重定向网址不匹配?我创建了关于mmm的应用程序... 2/3小时前。需要等待更多?我检查了url,他们都匹配我的脚本和控制台API。

3-正如我从api控制台看到的,有可能需要更多的配额达到500K每天的请求,它是如何工作的?这是否需要结算?

谢谢。

解决方案

1)您应该使用服务帐户,而不是共享某人的凭据。请记住,访问令牌会在一小时内过期,因此您的方法仍需要注意刷新这些令牌。

2)配置凭证之间没有任何延迟在API控制台中以及它们的生存时间。请仔细检查您的重定向网址是否与API控制台中的重定向网址完全匹配,包括尾部斜线和http / https。3)如果您需要更多配额,填写一份表格,说明你需要什么。如果授予额外配额,则不需要开票。


1 - Is possible to run upload/download of files to google Drive API using always the same access token, a sort of shared host for all my site's users, where they can upload and download directly files? if yes how to do that? Just using "static" access token variable in php client creation/authorization?

2 - Why i setted up my web application project on google api console enabling Gdrive api and it still tells me that my redirect url mis-match? i created the app about mmm... 2/3 hours ago. Need to wait more? I checked the url and they both matches on my script and in console api.

3- As i see from the api console, is possible to require more quotas reached the 500K requests per day, how it works? does this require for billing? How much more quotas can i ask and in which cases?

Thanks.

解决方案

1) instead of sharing someone's credentials, you should use Service Accounts. Remember that access tokens expire in one hour, so your approach would still need to take care of refreshing those tokens.

2) there's no delay between the time you configure your credentials in the APIs Console and the time they are live. Please double check that your redirect URL matches exactly the one in the APIs Console, including trailing slashes and http/https.

3) if you need more quota you'll have to fill a form explaining what you need. No billing is required when if additional quota is granted.

这篇关于Google Drive API访问令牌和重定向网址问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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