+ Start a Discussion
J&A-DevJ&A-Dev 

Question on Callout limits

Hi all,

 

I'm reading page 206 on the Apex reference doc and it states that one Apex transaction can make 10 callouts to an HTTP request. If I need to make more than 10 callouts, what are all my options other than using the @future notation? I'm calling a geocoding webservice, and the app will be making closer to 200 callouts/day.

 

Any suggestions will be appreciated.

 

Thanks in advance.

rungerrunger

Well, the limit of 10 is for a single request, not per day.  I'm a little confused about what you're asking.  Do you actually need to make more than 10 callouts during a synchronous transaction?  Meaning that the user is going to be sitting and waiting for all those callouts to complete before getting any response?

J&A-DevJ&A-Dev

runger,

 

Thanks for the response. I'm making HTTRequests to the Google Maps API to get addresses geocoded. The trick is that their REST API only accepts one address to be submitted per request. So far, I'm envisioning this app to work from a Batch Apex job that will run at a certain time and pick up only the records that need to be re-geocoded and then submit REST calls to the Google servers per each address.

 

What I'm still not clear on is if I'd be able to make 10+ HTTPRequests within a Batch Apex invocation. For example, let's say that my Batch Apex job runs and it has identified that 30 addresses need to be re-geocoded. The Batch class will then make the callouts to the Google servers within itself.

 

Sorry for the confusion.

rungerrunger

Batch requests are even tighter on callout restrictions than normal requests are.  But, if you're willing to go asynchronous (as batch would imply), then what is the problem with using @Future?  That would seem to be the right choice for your situation.

J&A-DevJ&A-Dev

I don't have issues using the @future notation. Just wanted to know all my options.

 

It seems that is the only way to approach it for now, that is what I'll do.

 

Thanks.

WilmerWilmer

Another choice is to use a custom button which calls a Visualforce page, and for each 10 callouts it goes back from the controller to your page, evaluates some criteria and returns to the controller in a kind of iteration process.

 

Regards,

 

Wilmer

KMForceKMForce
You can make more than 10 callouts in a transaction.
Follow the post.
http://techstuffdiary.wordpress.com/2014/02/28/no-callout-limit-and-doing-dmls-before-callout/