Case in point – why we have API limits

This week the customer I’m working for went live with the next phase of their Salesforce rollout. The phase includes a Contact Sychronization feature where Salesforce contact objects are synchronized to users mobile devices using their Google Account. The contacts are flagged either in bulk or specifically using a Lightning Component on the Contact Page, has Salesforce1 integration to allow users to perform and manage sync on the go as well as a delegation feature to allow other users to manage their synchronization settings on their behalf. Think managing partners etc…

Anyway we went live on Monday morning and Tuesday morning the news hit. We had hit the API limit. The API limit is a hard upper limit on the number of API calls any customer may do towards Salesforce from external applications. There are a number of factors deciding the actual limit such as user count, license types etc. but in this case the limit was 500.000 calls in a 24 hour rolling period. We were at 555.593! Not good and and it was only 9am. Hmmm what could be wrong?

After looking into the matter we found out that the culprit was – you guessed it – the Contact Sync. The actual sync component that does the reads from Salesforce and writes to the Google Accounts of the Contact Sync feature was set to run every 10 seconds and not every 15 minutes as planned. At this rate the customer would hit an estimated 20.000.000 (20 million) API calls in a 24 hour window. Not good. A simple reconfiguration and we were back on track.

Talking to the friendly people at Salesforce Support we were even given an extra allowance of API calls for the day and the customer were back in business.

But case in point – this is exactly why there are (API) limits. If you hit the limits you are probably doing something you shouldn’t. Well hopefully that’s why you hit the limit.