Google Simple API Key stops working

I am using Python / Twisted to make asynchronous HTTP calls in the Google+ API. Our client application passes through the user access_token, and we call the API call ...

https://www.googleapis.com/plus/v1/people/me/?%s&key=%s& 

... where% s and% s are filled with a valid access_token and (presumably) a valid Simple API Key, respectively.

Everything worked fine yesterday. Today I continued to work on unit tests for this, when the API suddenly started returning:

 { "error": { "errors": [ { "domain": "usageLimits", "reason": "keyInvalid", "message": "Bad Request" } ], "code": 400, "message": "Bad Request" } } 

useLimits, keyInvalid ... Ok, I get it. I seem to be out of use and they have invalid API keys from this account. Besides, I don’t ...

The “Courtesy limit” should be “10,000 requests / day,” but I only made a couple of hundred calls (according to Google’s usage graphs on Google) and I still see “0% used” on the quotas tab.

I would bring it directly to Google, but they seem to have abandoned their Google Group developers in favor of a discussion on Google+ that actually gets no answers.

Any help or guidance is greatly appreciated. Thanks!

+6
source share
5 answers

The answer was pretty simple! You cannot send both access_token and key to the same API call. If you use access_token, you authenticate the API call as a user, if you use your Simple API Key projects, you authenticate yourself. If you use both methods, the call fails.

+5
source

Just so that we understand, you use your key on the Google API Console page. There you will see the "API Access" tab in the upper left corner of the page. Make sure the API key you use is your Key for browser apps (with referers) , otherwise it will not work.

Anyway, the API request for me is as follows:

https://www.googleapis.com/plus/v1/people/114789529333378876576?key=ENTER_YOUR_KEY_HERE

You should be able to make at least one API call per day without a valid key.

+8
source

It took me quite a bit of time to understand, so I hope to save a little to someone else :)

Take a look at tho spost, google staff (in 2012) https://groups.google.com/forum/#!topic/google-ajax-search-api/HuKhXfsoMQc

Sorry for the delayed reply. This error (we are working on improving descriptiveness) also occurs when you have a restriction on your key (for example, an address blocked for a specific referent or IP address). Please confirm that if you set such a restriction in the APIs that the referent or IP address you are creating requests from. Pay particular attention to any wildcards used by the referent - for example, if you use * .abc.com, it will not work if your request comes from "yoururl".

It would also be great if the Google team fixed this problem! :)

+1
source

In my case, I had a parameter called Key, so he thought it was the actual key, just renamed the parameter.

0
source

In my case, I just had to wait a few minutes, because it was not a long time after updating my API key. Whenever you create a new key or update it on the YT developer console. YT has up to 15 minutes to make all changes on their side.

0
source

Source: https://habr.com/ru/post/948589/


All Articles