You need to sign in to do that
Don't have an account?
GAURAV SETH
How to make more than 100 API Calls
Hi Everyone, I have a requirement where we need to make more than 100 API calls in real time. As we all know that will hit governor limits.
We can't use Batch to call the API's . What is the best way to handle such situation ?
We can't use Batch to call the API's . What is the best way to handle such situation ?
Kindly refer this link which exactly matches your requirement :-
https://salesforce.stackexchange.com/questions/196916/more-than-100-api-calls-and-insertion-of-more-than-1000-records
Also, if needed, to increase the limit of API request, you can refer this document :-
https://help.salesforce.com/s/articleView?id=000315571&type=1 (https://help.salesforce.com/s/articleView?id=000315571&type=1)
Kindly mark it as the best answer if it helps you.
Thank you,
Priya Ranjan
Level 1 have only 1 API Call-This is fine
Level 2 can have more than 100 API calls for each item
Level 3 can have more than 100 API calls for each item
Since you mention making the calls in "real time" I'm assuming you have some sort of screen interaction that launches these calls. If so, you should be able to implement one of the following options:
Option 1: Define all the API calls you need as a discrete list of some sort of SObject with the description of what API call is needed (possibly as uncommitted Task objects, if nothing else works for you), then submit the batch and monitor it for completion in javascript (with periodic alls to apex to get the batch job status).
Option 2: Offload the api calls themselves to javascript and store the results of each until they all complete, or even fill in your screen as API calls return with additional information.
Option 3: Depending on what determines the suite of API calls you need, you could split them into separate method calls where each method performs < 100 API calls and then string your controller method calls together sequentially from your screen (vf page/lwc component, whatever) so that as each finishes the next one is invoked. Each controller method invocation is a separate request in saleforce and subject to a new set of limits.
Option 1 and Option 2 doesn't fit to my requirement as API calls are not directly requested from the screen.
We need to have some calculation in Apex and then need to call those API's based on the result.