function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sayirbsayirb 

Monthly data update from External API

Hi,

 

    I have to get  data from an external API by a unique ID. It is a REST API, serves one ID per request. There are more than 100 IDs to process in first day of every month. 

 

  I have set up a Scheduled apex job at every month. But there is a limit exception on callouts in apex class.

 

I need a better solution to achieve my tasks.

 

Thanks for any direction

 

 

Noam.dganiNoam.dgani

Hi,

 

Build your set of IDs and use batch apex with Batch size of 10 (summer 12 allows 10 callouts per batch job).

in each batch job, send 10 callouts - 1 for each ID in the batch and process the response.

 

this way you done have to worry about limits and if its a monthly process, i'm guessing that it doesnt require immediate operations so batch apex should do the trick.

 

hope this helps.

if it does, please mark the issue as resolved.

 

Regards

 

 

sayirbsayirb

Hi Noam,

 

 Thanks for your help. I have to save the data to Sobjects after each webservice callouts.

 

 Is batch apex suitable for this functionality?

 

Regards