“超过未授权使用的每日限制"的含义是什么. Google Drive API的提示信息? [英] What is the meaning of "Daily Limit for Unauthenticated Use Exceed." message of Google Drive API?

查看:604
本文介绍了“超过未授权使用的每日限制"的含义是什么. Google Drive API的提示信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个表单,用户可以在其中从Google云端硬盘上传文件.我有客户ID(免费帐户和付费帐户).我正在使用 Google云端硬盘API ,并尝试下载excel,文档和其他类型的文件.之前的file.get服务给了我结果,但是突然间它停止了给结果提供结果(仅对于工作表和文档.对于其他类型的文件,我可以从API中看到正确的响应).我每次都会收到以下消息.

I am building a form where a user can upload a file from Google Drive. I have the client ids (both free and paid account). I am using the Google Drive API and tried to download the excel, document and other types of files. Earlier the file.get service was giving me the result, but suddenly it stopped giving results (for sheets and documents only.. for other types of files I can see the proper response from the API). I am getting the following message every time.

未经身份验证的使用的每日限制已超过.继续使用需要注册.

Daily Limit for Unauthenticated Use Exceed. Continue use require signup.

尽管我正在使用httpClient服务在Drupal中编写代码,但我也使用curl对其进行了尝试.这是示例代码:

Though I am writing the code in Drupal using httpClient service, I have tried it with curl as well. Here is the sample code:

// $url is the response from Drive Picker API.
list($id, $orignal_name, $google_token) = explode('@@@', $url);
$headers = [
  'Authorization' => 'Bearer ' . $google_token,
]';
$crl = curl_init();
$setopt_array = array(CURLOPT_URL => $remote_url, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => $headers);
curl_setopt_array($crl, $setopt_array);
$response = curl_exec($crl);
curl_close($crl);

我不知道消息是关于什么的.关于免费帐户吗?如果是这样,我尝试使用付费帐户(与之关联的信用卡).

I couldn't figure out what the message is about. Is it about the free account? If so, I have tried with a paid account (credit card linked to it.)

如果是关于域验证的,那么我做了一个窍门,首先,我验证了一个正常工作的域,并使用代理设置在我的本地网站上使用了该域名.

If it is about domain verification, I did a trick, first I verified a working domain and used the domain name on my local website using the proxy settings.

我知道我必须使用'file.export'API来下载文件,但是我需要file.get来获取文件的mimeType.我需要知道问题背后的确切原因是什么,以便可以使用Google Drive API下载文件.

I know I have to use 'file.export' API to download the file, but I need file.get to get the mimeType of the file. I need to know what is the exact reason behind the issue so I can download the file using Google Drive API.

推荐答案

这个问题在SO上已经回答了很多次.

This question has been answered many times on SO.

该错误表明您未在Drive请求中提供http Authorization标头.这是由您的代码中的错误引起的.

The error is saying that you haven't provided an http Authorization header with your Drive request. This is caused by a bug in your code.

这篇关于“超过未授权使用的每日限制"的含义是什么. Google Drive API的提示信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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