+ Start a Discussion

Apex Callout exception: How to work around it ?

I am trying to work with a 3rd party service api . One of the methods they have brings in all records which takes a lot of time , about 9 mins ( i tried this using chrome app "Advanced Rest Client"). Resetting the HttpRequest timeout to 120 secs (which is the max) in Salesforce doesn't really help here. Any other suggestions ?
Can you limit the records that you are bringing in, such as by date/time updated? If you can do that, then you could save all of the data in a custom object in Salesforce. Then, when you actually call the API, you only need to retrieve records that were updated since the last time you did the callout, which might take significantly less time. You can use that API call to update your data in Salesforce, and then use a SOQL query to get whatever data you need.