Set up your environment
Choose the project your jobs belong to, and set up the address and API key your requests use.
Before you create a job, choose the project it belongs to and set up how your code calls the scheduler.
Choose a project
A job belongs to one project, and the people and keys that can reach that project can reach its jobs. Use one project for each app and environment, so that jobs for your live app are kept apart from the ones you are testing.
- In the console, open the project switcher in the header and select the project, or create one.
- Open Settings for the project.
- Copy the Project ID. Every API path for jobs includes it.
Set up authentication
Every request to the API carries an API key as a bearer token. Create one in the console with the Scheduler service and the permissions your code needs. See API keys.
Authorization: Bearer dsk_…A missing, unknown, or expired key gets Authentication required. A key without the permission, or not allowed in the project, gets Forbidden.
Set your environment variables
Send every request to https://scheduler-api.digitospace.com. The examples in these guides read your token and project from environment variables:
export SCHEDULER_TOKEN="your-token"
export PROJECT_ID="your-project-id"Replace each value with your own.
Check it works
List the project’s jobs. A new project answers with an empty list:
curl "https://scheduler-api.digitospace.com/v1/projects/$PROJECT_ID/jobs" \
-H "Authorization: Bearer $SCHEDULER_TOKEN"{
"data": [],
"meta": {
"requestId": "01m3c081dbf3j55x7hsa7wc1yj",
"page": { "limit": 50, "nextCursor": null }
}
}What’s next
Last updated