How do I monitor gmail API usage from Microsoft Flow? - gmail-api

I have used Microsoft Flow to check for new emails with specific labels using their gmail connector trigger 'when a new email arrives'.
Up until now I have had four flows running perfectly for over a year, until last Friday when errors started occurring. I am now testing with just one flow, single concurrency, which runs every minute (Flow Plan 2). The mailbox being checked receives at most 200 new messages per day, fairly spread out.
This is the error message which happens after the flow runs sucessfully 2-3 times a minute apart:
{
"statusCode": 403,
"message": "Out of call volume quota. Quota will be replenished in 23:01:41."
}
Microsoft claim this is related to the gmail API limit of no more than 60 calls per 60 seconds, even though the message above suggests a refresh of the quote in something close to 24 hours. It seems more like we are hitting some kind of daily limit, but the only one I could find on the gmail usage limits page is for 1,000,000 quota units per day, and I'm certain we are far short of that.
I have tried accessing quota usage from https://console.developers.google.com but since I didn't make a project and everything is setup from the Microsoft flow, there is no quota data shown.
Q: How can I verify the number of api calls being made from Microsoft Flow via the gmail connector, if that's even possible?
Note, I also started a thread on the Microsoft Power users forum to get help, but I figure if it's gmail API related then I may get better answers here.
Edit 27th Aug: Resolution was to export the flows to a new microsoft account. For whatever reason, the flows run fine on the new account (even though it has the same flow subscription). Microsoft still cannot explain why the flows would halt on one account and not on another.

Related

Quota exceeded for quota metric 'Queries' and limit 'Queries per minute per user' of service 'gmail.googleapis.com'

Our application makes use of a service account that has been authorized for the entire domain by the admin. With this service account our application accesses the domain user's emails with Gmail APIs like GetMessage.
All of a sudden, starting this week, we have started receiving the errors intermittently
Quota exceeded for quota metric 'Queries' and limit 'Queries per minute per user' of service 'gmail.googleapis.com' for consumer 'project_number:XYZ
There is no change in our application or frequency at which we access emails. We are using batch size of 10 while using the API.
The 'Quota exceeded errors count (10 sec) - Queries per minute' graph in the GCP dashboard is empty. So we are really not sure what is going on and why we are suddenly hitting the quota limits.
Also, I am not sure how the 'per-user' limit is applied when my app accesses the user mailboxes with the service account. The documentation around this is vague, at least to me.
These errors are really impacting our ability to serve our customers. Moreover not knowing why we are getting these errors is shaking our confidence in the Gmail APIs.
Any help in this regard is highly appreciated.
Thanks
UPDATE:
Today we are seeing lots of
"User-rate limit exceeded. Retry after <timestamp>"
errors. Seems like this time around we are hitting some quota limit other than 'queries per minute'. While I look in my client implementation and figure out why this is happening, feel free to share any recommendations you may have.
Thanks.
Google analytics has limits and quotas on API requests. You can increase it. If you don't want to do it, daily quotas are refreshed at midnight Pacific Standard Time.

Google Calendar API: error «Calendar usage limits exceeded»

Problems
As part of my task to provide the ability to manage events via the Google Calendar API. Events use two groups of guests (attendees):
- Group 1 is Google accounts with alternative mail from the same domain (for example site.com)
- Group 2 is person with email all around the world.
This may be a conference call with the participation of 3-10 people, and the annual meeting of about 100 guests. On all events there can be representatives from both groups.
But I am faced with a restriction on the use of the API, which does not allow us to accomplish this task. I managed to find out the cause of this error and reduce the data to analyze the problem to a minimum.
Workflow and mechanism
Group 1: Each Google Calendar user is a separate personal Google account with setting “Alternative emails” from the same domain. They have an additional shared calendar for these events, with email notification enabled.
Group 2: This is person with email all around the world, that may have an Google Calendar Account or do not, which are used as the Guest ID for the event.
The organizer (group 1) has an authorized valid access token. He creates an event with a the list of guests. As the guest ID is used Calendar_ID account.
At first, the event was successfully saved correctly and the notification was received for external participants successfully, without errors. But after several repetitions of creating events similar in parameters, an error began to occur. I get the Calendar usage limits exceeded error:
{"error": {"errors": [{"domain": "usageLimits", "reason": "quotaExceeded", "message": "Calendar usage limits exceeded."}], "code": 403, "message ":" Calendar usage limits exceeded. "}}
Although if you save the event only for yourself in own calendar_id without any participants, the following error does not occur!
I have processed enough materials and similar problems from sites:
- https://developers.google.com/calendar/support
- https://stackoverflow.com/questions/tagged/google-calendar-api
- https://productforums.google.com/forum/#!forum/calendar
There are several pages indicating a similar problem, but there are no specific solutions or workarounds.
And I see only one real reason for the appearance of such a restriction:
https://support.google.com/a/answer/2905486?hl=en
"Sending too many invitations or emails to external guests". Perhaps I have reached this limit of 100-300. But what to do with it?
Additional investigation
For the tests I have created a completely new test environment:
1. A separate Google user has been created as an organizer, with his own calendar and additional calendar.
2. Created a separate Google user as a guest for the event, with your calendar and additional calendar
3. All creation of events was used via web calendar.google.com interface.
As result:
- An additional attendee's calendar has reached the limit after creating the 4th event, within 5 minutes
- The main calendar - after creating the 15th event, within 15 minutes
I got a restriction that I should try to create an event later. Perhaps there is some kind of limiter on the frequency of creating/updating an event, but nowhere is this mantioned.
With a break of 4 hours, I was able to create only 5 events for the main calendar, I could not add an additional event to the additional calendar due to an error.
Questions
1. How do I get around these calendar blocking restrictions? In addition, all guests receive this event as desired and are clearly ready to confirm receipt of such events (subscribe to events from certain organizers).
Is it possible to perform this task using G Suite solution or another similar?
Could you please provide me with some an extended documentation on the API of the Calendar about:
conditions for calendar limitation exceeded (I have not found these criterias for using the API of the Calendar on the official website and pages of official forums)
time to unlock to save/update the event, after the occurrence of "Calendar usage limits"
Thanks in advance for your rapid reply as soon as possible.
Based from this support page:,
Calendar usage limits exceeded. This is the result of an API call. (Don't mix this up with the message "Daily quota exceeded," which points to insufficient API quota.)
It also means that the user reached one of the Google Calendar limits in place to protect Google users and infrastructure from abusive behavior. (Reference.)
Suggested actions:
Read more on the Calendar usage limits in the G Suite Administrator help.
If one user is making a lot of requests on behalf of many users of a G Suite domain, consider using a Service Account with authority delegation (setting the quotaUser parameter).
Use exponential backoff.

How much AppEngine Instance hours should I expected?

I have just developed a mobile apps which basically for users to upload, download photoes, add, update, search , delete, refresh transaction, and query report. Every action need submit request to Appengine Server.
I am using CloudEndpoint, oAuth2.0 and Objectify to implement this appengine. When I'm testing alone, The instance hours has used up 40% . How much billing for instance can I imagine if 100 people using this app? How does it calculate the instance hours? by request of submitting? or by time of instance working on multiple request??
is it worth?
If my target is more than 100 users to using my apps. Is it worth? Could you please share me what exactly I misunderstood about this instance.
Thanks
As others have commented, the question is very hard to answer. The easiest answer I can think of is by looking at the response header "X-AppEngine-Estimated-CPM-US-Dollars". You have to be a member of the Cloud Platform Project (see the Permissions page in Cloud Platform developers console) to see this header (you can check it in your browser).
The header tells you what the cost of the request was in US Dollars multiplied by 1000.
But think of it as an indication. If your request spawns other processes such as tasks, those costs are not included in the number you see in that header.
The relationship between Frontend instance hours and the number of requests is not linear either. For one, you will be charged a number of minutes (not sure if it's 15 minutes) when the instance spins up. And there are other performance settings that determine how this works.
Your best bet is to run the app for a while against real users and find out what the costs were in a given month or so.

Google App Engine - Can't Update Budget

I have billing enabled on my project, and have even issued a $10 payment just to test out the process (it works). But I am unable to change my daily budget on the google app engine dashboard.
I go to "Billing Status" section.
I am entering the new daily budget and I hit the "submit" button.
I am getting the not very informative error: "There was an error processing the request".
So I'm stuck without being able to update my budget, and my quota has exceeded for instance hours. My users are receiving errors and I am losing money, without any option of reaching out to Official Google Support (tried to email support - it can take up to a couple of days for them to get back to you, and the phone number requires a PIN that only premium customers get. becoming a premium customer also takes a couple of days...).
Any suggestions?
I have already tried:
making sure I have only one Google account signed in while changing the budget
replacing payment method
adding another user as a billing admin and changing the budget with that user
Nothing seems to work.
UPDATE: After reaching out to a developer advocate from Google, I found out that they are aware of this issue. They claim to have solved it last night, and for me the bug is now solved.

Salesforce API 10 request limit

I read somewhere that the Salesforce API has a 10 request limit. If we write code to integrate with Salesforce:
1. What is the risk of this limit
2. How can we write code to negate this risk?
My real concern is that I don't want to build our customer this great standalone website that integrates with Salesforce only to have user 11 and 12 kicked out to wait until requests 1-10 are complete?
Edit:
Some more details on the specifics of the limitation can be found at http://www.salesforce.com/us/developer/docs/api/Content/implementation_considerations.htm. Look at the section titled limits.
"Limits
There is a limit on the number of queries that a user can execute concurrently. A user can have up to 10 query cursors open at a time. If 10 QueryLocator cursors are open when a client application, logged in as the same user, attempts to open a new one, then the oldest of the 10 cursors is released. This results in an error in the client application.
Multiple client applications can log in using the same username argument. However, this increases your risk of getting errors due to query limits.
If multiple client applications are logged in using the same user, they all share the same session. If one of the client applications calls logout(), it invalidates the session for all the client applications. Using a different user for each client application makes it easier to avoid these limits.*"
Not sure which limit you're referring to, but the governor limits are all listed in the Apex documentation. These limits apply to code running in a given Apex transaction (i.e. in response to a trigger/web service call etc), so adding more users won't hurt you - each transaction gets its own allocation of resources.
There are also limits on the number of long-running concurrent API requests and total API calls in a day. Most of these are per-license, so, again, as the number of users rises, so do the limits.
Few comments on:
I don't want to build our customer this great standalone website that integrates with Salesforce only to have user 11 and 12 kicked out to wait until requests 1-10 are complete?
There are two major things you need to consider when planning real-time Sfdc integration beside the api call limits mentioned in the metadaddy's answer (and if you make a lot of queries it's easy to hit these limits):
Sfdc has routine maintainance outage periods.
Querying Sfdc will always be significantly slower than a querying local datasource.
You may want to consider a local mirror of you Sfdc data where you replicate your Sfdc data.
Cheers,
Tymek
All API usage limits are calculated over 24 hours period
Limits are applicable to whole organization. So if you have several users connecting through API all of them count against the same limit.
You get 1,000 API requests per each Salesforce user. Even Unlimited Editions is actually limited to 5,000.
If you want to check your current API usage status go to Your Name |
Setup | Company Profile | Company Information
You can purchase additional API calls
You can read more at Salesforce API Limits documentation

Resources