Does the Salesforce API limit apply on outbound API requests or only on the inbound API requests?
From this Knowledge article:
- What counts towards my API limit?
SOAP (https://www.salesforce.com/developer/docs/api/Content/sforce_api_calls_list.htm) and REST API calls (which include Bulk API calls) are counted against an organization API call limit.
This appears to be an inbound call that will be counted against the API. But it's quite strange when I tried it out in my developer org:
- I got a new developer edition.
- Logged in and navigated to Company Information and the API calls are at 0, as I would expect
- I went to developer console, and executed the following script that makes an API callout to GitHub API. It'd fail as it wouldn't have authentication, but it'd make the API callout alright. (I've also added it in remote site settings)
Http h = new Http();
HttpRequest req = new HttpRequest();
req.setMethod('GET');
req.setEndpoint('https://api.github.com/users/mralexgray/repos');
HttpResponse response = h.send(req);
System.debug(LoggingLevel.INFO, 'response :' + response);
When I executed this script once and checked the API calls, I expected it to remain at 0. But for some reason, it's 31 calls! which is a weird number.
I've executed that in a for-loop for 10 times and the API calls grew to 60 and I now have no idea if my external callouts are being included in the API limits.
Anyone else noticed this? Would love to hear your thoughts, thanks!
P.S: I've also checked this question, which I thought has the right answer until my own test.