Google api 谷歌分析API请求返回验证码?

Google api 谷歌分析API请求返回验证码?,google-api,google-analytics-api,google-api-php-client,Google Api,Google Analytics Api,Google Api Php Client,从昨天开始,我们与Google Analytics API的连接返回一个HTML页面,其中包含。。。验证码。有人经历过这样的事情吗 我们将API与PHP库一起使用。我们用于检索报表的代码(它包装在我们自己的类中,但使用google/apiclient包): 我们捕获到一个Google服务异常,错误消息如下: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head>

从昨天开始,我们与Google Analytics API的连接返回一个HTML页面,其中包含。。。验证码。有人经历过这样的事情吗

我们将API与PHP库一起使用。我们用于检索报表的代码(它包装在我们自己的类中,但使用google/apiclient包):

我们捕获到一个Google服务异常,错误消息如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><meta http-equiv="content-type" content="text/html; charset=utf-8"><meta name="viewport" content="initial-scale=1"><title>https://analyticsreporting.googleapis.com/v4/reports:batchGet</title></head>
<body style="font-family: arial, sans-serif; background-color: #fff; color: #000; padding:20px; font-size:18px;" onload="e=document.getElementById('captcha');if(e){e.focus();}">
<div style="max-width:400px;">
<hr noshade size="1" style="color:#ccc; background-color:#ccc;"><br>
<form id="captcha-form" action="index" method="post">
To continue, please type the characters below:<br><br>
<img src="/sorry/image?id=14645528721876966739&amp;q=EgSIkL9bGIjOzu4FIhkA8aeDSycUmKeaKy3bPExiN-Ol2PpxQzOfMgFj&amp;hl=en&amp;continue=https://analyticsreporting.googleapis.com/v4/reports:batchGet" border="1" alt="Please enable images"><br><br>
<input type="text" name="captcha" value="" id="captcha" size="12" style="font-size:16px; padding:3px 0 3px 5px; margin-left:0px;"><br><br><br>
<input type="submit" name="btn-submit" value="Submit" style="font-size:18px; padding:4px 0;">
<input type='hidden' name='q' value='EgSIkL9bGIjOzu4FIhkA8aeDSycUmKeaKy3bPExiN-Ol2PpxQzOfMgFj'><input type="hidden" name="continue" value="https://analyticsreporting.googleapis.com/v4/reports:batchGet">
</form>
<hr noshade size="1" style="color:#ccc; background-color:#ccc;">

<div style="font-size:13px;">
<b>About this page</b><br><br>

Our systems have detected unusual traffic from your computer network.  This page checks to see if it&#39;s really you sending the requests, and not a robot.  <a href="#" onclick="document.getElementById('infoDiv').style.display='block';">Why did this happen?</a><br><br>

<div id="infoDiv" style="display:none; background-color:#eee; padding:10px; margin:0 0 15px 0; line-height:1.4em;">
This page appears when Google automatically detects requests coming from your computer network which appear to be in violation of the <a href="//www.google.com/policies/terms/">Terms of Service</a>. The block will expire shortly after those requests stop.  In the meantime, solving the above CAPTCHA will let you continue to use our services.<br><br>This traffic may have been sent by malicious software, a browser plug-in, or a script that sends automated requests.  If you share your network connection, ask your administrator for help &mdash; a different computer using the same IP address may be responsible.  <a href="//support.google.com/websearch/answer/86640">Learn more</a><br><br>Sometimes you may be asked to solve the CAPTCHA if you are using advanced terms that robots are known to use, or sending requests very quickly.
</div>

IP address: xxx.xxx.xxx.xxx<br>Time: 2019-11-19T08:25:44Z<br>URL: https://analyticsreporting.googleapis.com/v4/reports:batchGet<br>
</div>
</div>
</body>
</html>

https://analyticsreporting.googleapis.com/v4/reports:batchGet


要继续,请键入以下字符:







关于此页面

我们的系统检测到来自您计算机网络的异常流量。此页面检查是否为';他真的是你在发送请求,而不是机器人

当Google自动检测到来自您的计算机网络的请求时,会显示此页面,这些请求似乎违反了。这些请求停止后,该块将很快过期。同时,解决上述验证码将允许您继续使用我们的服务。

此流量可能是由恶意软件、浏览器插件或发送自动请求的脚本发送的。如果共享网络连接,请向管理员寻求帮助&mdash;可能是使用相同IP地址的不同计算机造成的

如果您使用的是已知机器人使用的高级术语,或者发送请求非常快,有时可能会要求您解决验证码问题。 IP地址:xxx.xxx.xxx.xxx
时间:2019-11-19T08:25:44Z
URL:https://analyticsreporting.googleapis.com/v4/reports:batchGet
如果有人也经历过这种情况或有解决办法,请让我知道


提前感谢。

这可能是谷歌应用了一些安全措施来应对流量激增。我还知道,他们在2019年11月4日更新了API的错误消息,这可能是我们现在收到此错误而不是以前收到的其他错误的原因

我从谷歌收到的电子邮件:

“我们将从2019年11月4日起将Google Analytics API升级到新的技术基础架构堆栈。由于这一更改,客户端将在失败API请求的响应错误消息文本中看到一些差异。”

“如果您的应用程序或日志分析工作流依赖于管理API v3或核心报告API v3响应中提供的特定措辞,则需要更新代码以反映新的错误响应文本。请注意,由于准确的错误消息措辞可能随时发生变化,我们强烈建议在处理API响应时,不要硬编码特定的消息文本。”

今天我的请求失败了,在我的错误日志中提供了一个验证码图像,生成了404。 我收到的错误:

“我们的系统检测到来自您计算机网络的异常流量。此页面检查是否真的是您发送请求,而不是机器人。”

“在这些请求停止后,阻止将很快过期。同时,解决上述验证码将让您继续使用我们的服务。”

此后,我发现该服务在不需要任何代码更改的情况下少量恢复运行

我建议再试一次,限制请求数量,直到服务100%恢复

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><meta http-equiv="content-type" content="text/html; charset=utf-8"><meta name="viewport" content="initial-scale=1"><title>https://analyticsreporting.googleapis.com/v4/reports:batchGet</title></head>
<body style="font-family: arial, sans-serif; background-color: #fff; color: #000; padding:20px; font-size:18px;" onload="e=document.getElementById('captcha');if(e){e.focus();}">
<div style="max-width:400px;">
<hr noshade size="1" style="color:#ccc; background-color:#ccc;"><br>
<form id="captcha-form" action="index" method="post">
To continue, please type the characters below:<br><br>
<img src="/sorry/image?id=14645528721876966739&amp;q=EgSIkL9bGIjOzu4FIhkA8aeDSycUmKeaKy3bPExiN-Ol2PpxQzOfMgFj&amp;hl=en&amp;continue=https://analyticsreporting.googleapis.com/v4/reports:batchGet" border="1" alt="Please enable images"><br><br>
<input type="text" name="captcha" value="" id="captcha" size="12" style="font-size:16px; padding:3px 0 3px 5px; margin-left:0px;"><br><br><br>
<input type="submit" name="btn-submit" value="Submit" style="font-size:18px; padding:4px 0;">
<input type='hidden' name='q' value='EgSIkL9bGIjOzu4FIhkA8aeDSycUmKeaKy3bPExiN-Ol2PpxQzOfMgFj'><input type="hidden" name="continue" value="https://analyticsreporting.googleapis.com/v4/reports:batchGet">
</form>
<hr noshade size="1" style="color:#ccc; background-color:#ccc;">

<div style="font-size:13px;">
<b>About this page</b><br><br>

Our systems have detected unusual traffic from your computer network.  This page checks to see if it&#39;s really you sending the requests, and not a robot.  <a href="#" onclick="document.getElementById('infoDiv').style.display='block';">Why did this happen?</a><br><br>

<div id="infoDiv" style="display:none; background-color:#eee; padding:10px; margin:0 0 15px 0; line-height:1.4em;">
This page appears when Google automatically detects requests coming from your computer network which appear to be in violation of the <a href="//www.google.com/policies/terms/">Terms of Service</a>. The block will expire shortly after those requests stop.  In the meantime, solving the above CAPTCHA will let you continue to use our services.<br><br>This traffic may have been sent by malicious software, a browser plug-in, or a script that sends automated requests.  If you share your network connection, ask your administrator for help &mdash; a different computer using the same IP address may be responsible.  <a href="//support.google.com/websearch/answer/86640">Learn more</a><br><br>Sometimes you may be asked to solve the CAPTCHA if you are using advanced terms that robots are known to use, or sending requests very quickly.
</div>

IP address: xxx.xxx.xxx.xxx<br>Time: 2019-11-19T08:25:44Z<br>URL: https://analyticsreporting.googleapis.com/v4/reports:batchGet<br>
</div>
</div>
</body>
</html>