Google API Error List


Please Share

Google API Error

 

There are only a handful of Errors that get returned when using the Google APIs.   Most of them are Open Authentication (Oauth / Oauth2) related.      I am going to build a list of the errors and their probable causes and possible solutions.

 

Open Authentication Errors

invalid_grant

  1. Your server’s clock is not in sync with NTP. (Solution: check the server time if its incorrect fix it. )
  2. The refresh token limit has been exceeded.       (Solution: Nothing you can do they cant have more refresh tokens in use)
    Applications can request multiple refresh tokens. For example, this is useful in situations where a user wants to install an application on multiple machines.  In this case, two refresh tokens are required, one for each installation. When the number of refresh tokens exceeds the limit, older tokens become invalid. If the application attempts to use an invalidated refresh token, an invalid_grant error response is returned. The limit for each unique pair of OAuth 2.0 client and is 25 refresh tokens (note that this limit is subject to change). If the application continues to request refresh tokens for the same Client/Account pair, once the 26th token is issued, the 1st refresh token that was previously issued will become invalid. The 27th requested refresh token would invalidate the 2nd previously issued token and so on.

invalid_client

Make sure that you have both product name and an email address set up in Google Apis Console

Invalid_client Google Api Error

 

subscriptions are in a suspended state

[412] Errors [ Message[You cannot sign up for Google Apps because one or more of your subscriptions are in a suspended state.]

Solution: Check Google developers console and check your billing options. I think either your credit card has expired or you forgot to pay your bill.

Your account is suspended so you cant make any requests.

Links to question on SO:  Subscriptions are in a suspended State error

invalid_grant: Code was already redeemed

This error requires a little explanation. When the user clicks authenticate you are given an authentication code. You take this code and exchange it for your access token and refresh token.

invalid_grant: Code was already redeemed

Means that you are taking an authentication code that has already been used and trying to get another access token / refresh token for it. Authentication code can only be used once and they do expire so they need to be used quickly.

… More to come as I remember them Feel free to post your error code and its solution if you have one i don’t have listed.

Please Share


Linda Lawton

About Linda Lawton

My name is Linda Lawton I have more than 20 years experience working as a developer and a database expert. I have been working with several of the Google APIs, since 2012. I helping others in the On-Line community to develop with the Google APIs, by creating my own blog www.daimto.com. This and my presence on a number of On-Line developer forums lead me to be noticed by the Google Analytics API development team. I was nominated for and recently became one of the first Google Developer Experts for Google Analytics.

Leave a comment

Your email address will not be published. Required fields are marked *