我们一直在使用Google Discovery API进行分析设置以发出请求:“ https://analytics.googleapis.com/ $ discovery / rest?version = v4”到目前为止,这种方法已经运行了两年多了,但是今天它开始回应:
googleapiclient.errors.HttpError: <HttpError 403 when requesting https://analytics.googleapis.com/$discovery/rest?version=v4 returned "The request is missing a valid API key.">
Run Code Online (Sandbox Code Playgroud)
我似乎无法在此api上找到任何状态,但感觉好像有些变化。
手动测试已经执行,我一直在重复该问题。
>>> credentials = oauth2client.client.GoogleCredentials("<redacted>", "<redacted>", "<redacted>", "<redacted>", None, "https://accounts.google.com/o/oauth2/token", "UserAgentHere")
>>> credentials
<oauth2client.client.GoogleCredentials object at 0x7f533eaf60b8>
>>> import httplib2
>>> http = credentials.authorize(http=httplib2.Http())
>>> http
<httplib2.Http object at 0x7f533eaf6390>
>>> from apiclient.discovery import build
>>> build("analytics", "v4", http=http, cache_discovery=False)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.6/site-packages/googleapiclient/_helpers.py", line …Run Code Online (Sandbox Code Playgroud)