Quickstart
Create your first scheduled job in under 2 minutes
There are a few different ways to schedule a job to execute an HTTP request:
- In the terminal with cURL
- In our dashboard
- With our Node SDK
Create your first job
Let’s start by creating a job that sends a message to the Booper Discord server in 30 seconds.
It will do this by scheduling a POST
request to https://scheduler.booper.dev/api/broadcast
with the channel
field of the request body set to "discord"
, and the content
field set to whatever message we want to broadcast.
In the terminal
The easiest way to do this is to copy and paste the following cURL request into your terminal.
Note that in the request body (in --data-raw
) we simply define the HTTP method
, url
, body
, and set it to run in 30 seconds with the schedule_in
parameter:
Note that the request above is using our public API key, which you should avoid using for anything private or important.
In the dashboard
After you’ve created an account, you can walk through setting up your first job on the onboarding page.
(You can also use the public API key in the public dashboard to create a job.)
With an SDK
If you want to trigger a new job from your codebase, you can use one of our SDKs, or simply make a request to the API with the HTTP library of your choice.
Let’s use our NodeJS SDK for example. First, install the @booper/scheduler
package:
Then, in your server code:
Schedule a recurring job
A recurring job is simply one that repeats at a set interval after executing for the first time. It’s very similar to creating a one-off job like we did in the previous section, but with a few extra features.
Let’s just create a job that pings the Booper API every 5 minutes after its initial run. It will do this by scheduling a GET
request to https://scheduler.booper.dev/api/ping
.
In the terminal
Once again, the easiest way to do this is to copy and paste the following cURL request into your terminal.
The main difference with the section above is that we now add the repeat_every
field set to [5, 'minutes']
:
Note that the request above is using our public API key, which you should avoid using for anything private or important.
In the dashboard
After you’ve created an account, you can walk through setting up a recurring job on the onboarding page or the new job page.
Make sure to check the box to Run on a recurring schedule
:
(You can also use the public API key in the public dashboard to create a recurring job.)
With an SDK
If you want to trigger a recurring job from your codebase, you can use one of our SDKs, or simply make a request to the API with the HTTP library of your choice.
Let’s use our NodeJS SDK for example. First, install the @booper/scheduler
package:
Then, in your server code, make sure to set the repeat_every
field: