Hierarchy

  • default
    • Jobs

Constructors

  • Example

    const OneBlink = require('@oneblink/sdk')

    const options = {
    accessKey: '123455678901ABCDEFGHIJKL',
    secretKey: '123455678901ABCDEFGHIJKL123455678901ABCDEFGHIJKL',
    }
    const jobs = new OneBlink.Jobs(options)

    Parameters

    Returns Jobs

Methods

  • Create a single Job

    Example

    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
    })

    Parameters

    • data: NewFormsAppJob

      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

    Returns Promise<FormsAppJob>

  • Delete a single Job

    Example

    const jobId = 'f73985fd-2dba-4bf7-abbe-e204889f5216'
    jobs.deleteJob(jobId).then(() => {
    // Job has been deleted
    })

    Parameters

    • jobId: string

      The exact id of the job you wish to delete

    Returns Promise<void>

  • Search Jobs

    Example

    const results = await jobs.searchJobs({
    username: 'user@domain.io',
    formId: 10,
    })

    // an array of jobs
    const jobs = results.jobs

    Parameters

    • Optional options: {
          externalId?: string;
          formId?: number;
          isSubmitted?: boolean;
          limit?: number;
          offset?: number;
          username?: string;
      }

      Search options

      • Optional externalId?: string

        The externalId property of a job

      • Optional formId?: number

        The formId matching the form that a job was created for

      • Optional isSubmitted?: boolean

        Whether the job has been submitted or not

      • Optional limit?: number

        Limit the number of jobs returned

      • Optional offset?: number

        Skip a specific number of results, used in conjunction with limit to enforce paging

      • Optional username?: string

        The username that the job was assigned to

    Returns Promise<JobsSearchResult>