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
Nick JosephNick Joseph 

Possible to schedule Apex HTTP callout

I've scoured the forums. Is it possible to leverage the Schedulable Inteface to schedule a REST Post callout every 30 minutes? I found a related article saying this was not supported, but its from 2010: https://developer.salesforce.com/forums/?id=906F0000000BLRzIAO#!/feedtype=SINGLE_QUESTION_SEARCH_RESULT&id=906F00000008xKiIAI
John TowersJohn Towers
No, this is not possible to make a callout directly from a scheduled class. You need to make the callout from a @future or queueable method. From the documentation (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_scheduler.htm):

"Synchronous Web service callouts are not supported from scheduled Apex. To be able to make callouts, make an asynchronous callout by placing the callout in a method annotated with @future(callout=true) and call this method from scheduled Apex. However, if your scheduled Apex executes a batch job, callouts are supported from the batch class. See Using Batch Apex."

You can also only run scheduled jobs as frequently as once an hour.