In my company we set up Google Calendar API to notify our providers when we have new missions to offer them and allow them to accept/refuse mission through the Google Calendar.
However, since last week we started getting quotaExceeded errors ("Calendar usage limits exceeded"). I checked quotas but figured out we are way below quotas (3,000 / 1,000,000 requests per day and 10 / 500 requests per 100 seconds).
HttpError: <HttpError 403 when requesting https://www.googleapis.com/calendar/v3/calendars/svbk5reui******l6h044qn3h4%40group.calendar.google.com/events/1meqllvk6******dt9poej9mk0?alt=json&sendNotifications=true returned "Calendar usage limits exceeded.">
After checking a bit further, I noticed there are also "hidden" quotas. I say "hidden" quotas beacause I can't find any feedback about the evolution of these quotas. I assumed we might have reached either "Send too many invitations to external guests" or "Email too many guests via Google Calendar events" quota. So I set sendNotifications=false where we used to set sendNotifications=true.
Since I made this change, we didn't experience the quotaExceeded error anymore. However, our providers are also not notified anymore when we offer them a new mission. So, I doubled the API calls with an e-mail sent to the providers including the link to the Google Calendar event.
Yet, now, some of them can't access the link, and the other can't answer if they will be attending the event or not.
How come setting sendNotifications=false disallows access or answering to the attendees? Can I check exactly what quotas are exceeded? And what are my solutions to notify our providers about new missions and allow them to see it in their calendar and answer it?
Related
I am working on developing integration with Google Calendar using Rest API. I got to know Google applies both rateLimit and usageLimit on API calls - 403_calendar_usage_limits_exceeded
In case I breach the limits, I want to wait for a defined period of time before I retry the request again. Is there any way to know if there is something like Retry-After header returned by Google.
I checked documentation but not able to find anything related - errors
You can see your quota in google developer console under libary search for google calendar and then click the manage button. Under the quota tab you will see something like this.
There are two types of quota user based quota denoted by the "per user" and project based quotas.
Each user running my application can make a max of 600 requests per minute. if they make to many then i will get a quota exception.
My application can make a max of 10000 request per minute in total. if it makes more then that then again i will get a quota exception.
You may want to read though Manage quotas this explains a lot about quota usage and the google calendar api.
For the most part if you just implement exponential backoff you should be able to avoid to many of these errors.
try request if fails
wait 10 seconds
try again if fails
wait 20 seconds
try again if fails
wait 30 seconds
try again
.......
We are doing an integration with Google Calendar Api, trying to publish events in a calendar, and then add them to the invited users (attendees) in their primary calendars. After doing a couple of tests and publications we skip the error message:
Calendar usage limits exceeded. [403]
We have read the documentation and the limits of petitions, but we are not passing at any time of that limit, and we skip the same error. We have seen in forums and in the same documentation of the API, that the reasons can be diverse, like the publication of more than 25 calendars, overcome the 10,000 events, etc.
In our case, we do not overcome any of those limitations. To get an idea, we did not surpass the 200 events in a couple of days. And since we started testing, events don't exceed 500. That is why we are trying to contact you as the last solution, because we do not know where the problem is.
Is there are any daily or sendings attendees exact limits ? Because we need to launch and update many of them, and don't know how to do it. How can we publish and share this events without having the limitation failure? In our Google Console we say that the quota still remain 1.000.000 queries per day.
To make myself understood, my procedure is: I have a general Calendar with a Json Keys, and I publish all my events in it. Then, I trying to add attendees and publish(share) part of my events with them. But I have the same error for days. I know that Google Calendar limits the number of invitations a user can send to external guests 100-300 guests exactly. But I do not know if is a limit per hours, days, or account? How we can do to publish many events with attendees without limits? Is there a solution for that?
As can be read in this post, besides what is written in the documentation itself, this is a hard limitation from Google to stop spammers.
Currently there is no real solution and it's up to Google. There are rumors that Google is trying to tackle this issue but nothing has changed in the mean time.
Basically, your only option is either to wait and see what Google does with this or abandon their solution and find an alternative.
I have a wordpress blog. When I logged in to the dashboard, the following exception was highlighted at the top:
[Ga_Lib_Api_Request_Exception] There was an error while contacting Google API: { "error": { "code": 429, "message": "Insufficient tokens for quota group and limit 'AnalyticsDefaultGroupCLIENT_PROJECT-1d' of service 'analyticsreporting.googleapis.com', using the limit by ID '123******456'.", "status": "RESOURCE_EXHAUSTED", "details": [ { "#type": "type.googleapis.com/google.rpc.Help", "links": [ { "description": "Google developer console API key", "url": "https://console.developers.google.com/project/207216681371/apiui/credential"}]}]}}
From the exception message I could infer that it is something related to Google Analytics and its API.
However, I'm curious to know what could have caused this exception. Also, what steps can I take in order to avoid such exceptions?
Manoj gave you the technical information I am going to give you a bit of extra info and answer the following part of your question.
However, I'm curious to know what could have caused this exception. Also, what steps can I take in order to avoid such exceptions?
When we as developers want to access Google APIs we need to register our application with Google. Each API has a different quota that the developers need to keep track of.
a quota is the number of requests you can make to an API.
For example: Considering the Google analytics by default each user of an application can make a maximum of 10 requests a second this is to prevent flooding the servers. You can also make a maximum of 10000 requests to each Google analytics View per day. Most of the quotas are user based however there is one that is project based. RESOURCE_EXHAUSTED is one such quota.
By default the project based quota for google analytics is 50000 requests. If you have a large number of users all making requests you can quickly run out of quota. The quota on my application for example is 500000 my users run though about 70% of that each day. Once you hit this quota there is nothing that can be done the application is locked out until the quota is reset at midnight west cost USA time.
What can be done to avoid it. First off the author of the plugin needs to request an additional quota so that they can service their users better they should also be checking this periodically so that there users never see it. Its probably going to take them a month to get approved for additional quota. As a user you can help by only making requests that you need to make there by not using to much of the daily quota up.
As Manoj stated there is nothing you can do personally to fix this you will need to contact the author of the plugin.
A quick search concluded that the analytics plugin used by your blog may be using more hits and quota that is permissible by google analytics api
You can find error description here and quota limits here. Please get in touch with plugin developer to get this sorted.
It was caused by a WordPress plugin you are using called "Google Analytics," which is one of many plugins you can use to easily insert analytics tracking code into your page's source. You might disable it and install another plugin that does this without causing errors.
In addition, if this plugin is synchronously pulling from Google's servers on each request, it is needlessly slowing down your page load times. There is no reason why the plugin needs to do this.
I am getting a HTTP 403 error with message: "... returned "User Rate Limit Exceeded">. after about 5K message translation. I have a deadline to get this done and the forum postings are not getting any responses from Google support.
The FAQ page states the following:
I get an HTTP 403 error when I call the API.
You may be exceeding your quota: either the daily billable total, or the limit on request characters per second.
To view or change usage limits for your project, or to request an increase to your quota, open the API Library in the Cloud Platform Console.
If you have enabled billing for your project, you can see the quota percentage for each API. You can view and change quotas from the API section's API Library and Enabled APIs links
======================*
I have my rate at the maximum allowable which is 10K/100sec/user, I cannot increase past that.
characters/100seconds/user 10,000
And when I go to the quota request page to ask Google support to increase it, the only thing I see is the character increase request, not the rate increase, and it does not let me submit the form.
How do I get someone at Google to look at this without paying $300 for silver support - that is the lowest level at which they provide phone support.
===============
*Translate API Quota Increase Request
This form should be used by customers of Google Cloud Platform for the following:
Owners of applications that wish to increase quota limit of Translate API to higher than 50M characters/day
If you wish to increase your quota, but will stay below 50M characters/day, please follow the steps listed on the Translate API FAQ page.
If you have other questions related to Translate API, please check this public forum for further help.
=================
I got the answer back from Google - you need to input 51 or greater into the request form (not 51M which I was trying and the form would just not let me submit).
At the current rate, my program will take about 8 hours to run if I put in the right timing delays, and I cannot monitor my program...hoping Google will increase the rate quota
If seems you're hitting the characters/100seconds/user quota. Currently there isn't any separate form to request an increase to this specific quota. You can request an increase by filling out the Translate API Quota Increase Request form. You'll need to specify 'Approximate translate volume (M characters/day)' as anything > 50 (e.g. 51) to get past the form validation. Inside 'Detailed description of API Usage' section, please explain in details that you need an increase to the characters/100seconds/user quota (along with desired increase) and not to characters/day.
I used gapi.class.php and have another analytics-dash.php template which I'm calling as an include on a page template in WP. This shows a chart and stats of analytics on the front end of WP to my admin and authors. This template is connected to my site's GA profile ID and all is well, it works and shows the stats. However, the first night after implementation we received the error "GDatadailyLimitExceededQuota" on the site. I have since removed the include script from my page template so the error will not show.
These are the steps I took to try and fix the problem:
I researched into the error "dailyLimitExceededQuota", which I researched and Google's API states the following:
"If quota is exceeded, Google Analytics API returns an error for additional requests:
HTTP status code 403 Forbidden and a message indicating that the specific account has insufficient quota to proceed...
50,000 requests per project per day
10 queries per second (QPS) per IP.
To get full quota, you must register your application in the Google Developers Console. When you register a new application, you are given a unique client ID to identify each application under that project."
Then I realized I needed to register with Google's Developer Console as the quota limit is very low for testing without registering.
I registered the application and turned on the Analytics API in the console. I'm not sure what else I am to do after registering the application.
I followed the instructions to increase the quota (Configuration and Reporting API Limits and Quotas)
by using this form:
Analytics API quota request
I went through the steps on the form to make sure I am setting this up correctly. On that form, it states the following:
"Quotas that CAN be increased:
Per project daily limit of 50,000 requests/day.
Per project daily limit of 500 uploads/day.
Quotas that CANNOT be increased:
Per profile (user) limit of 10,000 requests/day [403 Error with Message about Profile limit: dailyLimitExceeded]
Per profile (user) limit of 10 concurrent requests per profile [403 Error: quotaExceeded]
Per IP limits of 10 queries/second (QPS) [403 Error: userRateLimitExceeded]"
... proceed to check that we "Verify that the quota you are asking for can be increased. See the list above."
This is referring to the quotas that can and cannot be increased (above). Since we received error "dailyLimitExceed", and this is associated with "per profile (user) limit of 10,000 requests/day" - this is under the list that CANNOT be increased. However this was before registering the application with Google's Developer Console so I'm thinking now, since I registered it as an application/project, it can be considered to have a daily limit of 50,000 requests/day. Then if I enable it again on our website, I'm thinking the error would not show, however this I am unsure because I'm not sure if I setup the registration fully. Could it be that simple to register an application?
The next step on the form states:
"(4) Verify your API requests are properly registered with a Developers Console Project. Check the Reports Developers Console. If total requests in the traffic report is 0 then your API requests are not registered to your project ID and you are not currently getting your full quota."
However, it is going to show 0 currently because I removed the include script from our website! So I'm thinking the only way to test against this (#4 on form) is to put the script back in. Then if the error shows, that could mean that either it is not communicating with the registered application I just created, or it simply exceeds the limit. Therefore I would need to fill out this form, which I did, to ask for a quote increase. However, I'm hesitant to put the script back in to display the analytics chart until I hear back from Google (not sure how long it takes for them to respond to the increase quota request) because I don't want another dailyLimitExceeded error to be thrown and show on the front end.
Any thoughts? Thank you very much for your consideration in helping.