Getting jobs

The proxy also provides convenient endpoints that allow getting jobs, either as a page of jobs based on some filtering options or a given job based on its job ID.

A page of jobs follows this interface:

interface JobsPage {
  start: number;
  length: number;
  count: {
    waiting: number;
    active: number;
    completed: number;
    failed: number;
  },
  jobs: JsonJob[];
}

Access the jobs endpoint providing a start and a length so that you can fetch a particula page of jobs.

curl --location 'http://mydomain.dev/queues/my-queue/jobs?\
statuses=completed,failed&start=10&length=20' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer my-secret-token'

If you are instead interested in getting one particular job based on its id, just use this endpoint instead:

curl --location 'http://mydomain.dev/queues/my-queue/jobs/my-job-id
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer my-secret-token'

And if the job exists you will get a JobJson object.

Last updated