3

Our org has hit API Request Limit again yesterday which is 25k in 24 hours. Since it is not a small number I am wondering how does that count. Suppose we were running a test class, how many API calls will be used? By understanding that we can analyse what is going wrong.

5

Every call to the API counts. This doesn't include test methods, because they can't call the API. API requests include Salesforce for Outlook, mobile apps, the Data Loader, etc. If many users are using Salesforce1, or if you have many integrations, such as synchronizing with Oracle or a third-party system, can consume many calls. For example, with a batch size of 200, if a user uploads 20,000 records, that is 100 API calls. A process that synchronizes just once every five minutes between Salesforce and an external system would use at least 288 calls per day, assuming no data was modified. It could easily be thousands of calls per day if there is a lot of activity in your organization. Apps that do not cache session IDs (e.g. those that login every five minutes when performing a sync) would consume extra calls. The Force.com IDE can easily consume hundreds of calls a day per user. You can work with Salesforce support to try and identify which apps or integrations are causing excessive API usage. The limit is aggregated every hour, and the last 24 hours are used for the total. This means if you use 10,000 calls in an hour between 12pm and 1pm, those calls will count against the limit until 1pm the next day. If this is an unusual case, it most likely has to do with a user uploading a large amount of data with the data loader.

5
  • Thank you for your reply. Our scenario is we four developers are all working on writing and testing unit tests yesterday which brings a large amount of API requests. We were using Mavensmate for the unit testing which I believe should be tooling API. But it shouldn't matter that much because I don't believe the execution of tests will count... Weird
    – Lance Shi
    Oct 15 '14 at 0:35
  • Calling the tooling API does count, but the tests themselves do not. It's not usual to run up many thousands of API calls when using Mavensmate or the Force.com IDE. For this reason, you should develop using Sandboxes, and only deploy to production when you're ready.
    – sfdcfox
    Oct 15 '14 at 0:37
  • I agree with you. But our scenario is a little bit complicated. We are using TSOs instead of sandboxes to develop code and doing version control using Git. I am just wondering why it has consumed thousands of calls
    – Lance Shi
    Oct 15 '14 at 0:43
  • A single async deployment could run 50 calls or so if the servers are delayed significantly, since async deployments are polled periodically. You'll want to review your Mavensmate settings to see if you can reduce your calls.
    – sfdcfox
    Oct 15 '14 at 1:00
  • Thank you for your reply. We still haven't figured out the reason but I think we are on the way now. Thank you for providing all the info which are greatly helpful.
    – Lance Shi
    Oct 15 '14 at 1:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.