Sampath
Sampath

Reputation: 1

How does the google batch API respond when user beyond his API quota (google developer batch/admin-sdk/directory/v1/)

I am using Google admin-sdk batch API for most of my use cases. I wonder how does google respond when the user hits rateLimit (API Quota). Does it set the outer response as 403 or individual response with 403 response code?

Upvotes: 0

Views: 61

Answers (1)

Jescanellas
Jescanellas

Reputation: 2608

According to the documentation, the API will return a JSON code with three different Reasons, depending of the issue causing the exception:

enter image description here

For example:

{
   "error":{
      "errors":[
         {
            "domain":"usageLimits",
            "reason":"dailyLimitExceeded",
            "message":"Daily Limit Exceeded. Please sign up",
            "extendedHelp":"https://code.google.com/apis/console"
         }
      ],
      "code":403,
      "message":"Daily Limit Exceeded. Please sign up"
   }
}

Upvotes: 1

Related Questions