Create a single Job
const newJob = {
username: 'user@domain.io',
formId: 1,
externalId: 'your-job-identifier',
details: {
key: 'JOB-123',
title: 'Job Title',
description: 'Job description',
type: 'Type',
priority: 3,
},
}
const preFillData = {
text_element: 'abc',
number_element: 123,
}
jobs.createJob(newJob, preFillData).then((job) => {
// job.id can be used to delete the Job
})
The Job to create
Optional
preFillData: Record<string, unknown>Key/value pairs with the form field names as keys and the pre-fill data as the values
Delete a single Job
const jobId = 'f73985fd-2dba-4bf7-abbe-e204889f5216'
jobs.deleteJob(jobId).then(() => {
// Job has been deleted
})
The exact id of the job you wish to delete
Search Jobs
const results = await jobs.searchJobs({
username: 'user@domain.io',
formId: 10,
})
// an array of jobs
const jobs = results.jobs
Optional
options: { Search options
Optional
externalThe externalId
property of a job
Optional
formThe formId
matching the form that a job was created for
Optional
isWhether the job has been submitted or not
Optional
limit?: numberLimit the number of jobs returned
Optional
offset?: numberSkip a specific number of results, used in conjunction with limit
to
enforce paging
Optional
username?: stringThe username
that the job was assigned to
Example