I have a scheduled batch job that in the start method, I make a REST API call to an external service. The external API has around ~2000 total results to return, but the API only returns 10 records per page. I am getting an apex error stating "Too many callouts 101".
public class CustomerBatchAPI implements Database.Batchable<SObject>, Database.Stateful, Database.AllowsCallouts{ public List<JobApplication__c> start(Database.BatchableContext bc) { public static APISettings__c APICustomSettings = APISettings__c.getInstance('API Integration'); List<JobApplication__c> ja = new List<JobApplication__c>(); List<JobApplication__c> jobAppList = ExternalCustomerAPI.synchJobApps(APICustomSettings.API_Key__c); ja.add(jobAppList); return ja; } } Is there a way to somehow avoid this error given the number of records I need to retrieve and pages I need to paginate through? For every page in the dataset, I am making a new API call so when there are 2000 records or more I always hit this apex limit.