Manage Enhanced Job Posting drafts

A draft can be saved after the hirer has reviewed their job ad in the Enhanced Job Posting panel. This draft can then be resumed, queried, previewed, or posted as a job ad to SEEK.

Trigger save of the draft job ad

When the hirer is ready to post or save progress on their current draft, your software should call dispatchEvent('seek:draft:save'). It returns a Promise to a result object. dispatchEvent('seek:draft:save') does not throw exceptions.

Result object

Result property
Type
Description
isError
boolean
Whether an error has occurred.
data
object | null
An object that contains information about the draft job ad.Only present when isError is false.
data.id
string
The ID of the saved draft job ad.
data.isComplete
boolean
Whether the draft job ad has all mandatory fields complete and is ready for posting.
If the save succeeded, then isError will be false, and data.id will contain the saved draft’s ID.If data.isComplete is true, the draft can be posted as a job ad using the postPositionFromDraft mutation. See post a draft job ad for more information.If data.isComplete is false, there are mandatory fields that the hirer has not yet completed. Attempting to post a draft that is not complete will result in a BAD_USER_INPUT error from the SEEK API.data.id can be saved alongside the job requisition in your software as a SEEK job ad draft, and used to resume editing later. If the hirer resumes their posting workflow from a draft, the id must be passed as the draftPositionProfileId prop to the render function.If there was some problem with saving the draft job ad, then isError will be true, and data will be null. Instructions will be shown within the panel for the hirer to resolve and retry saving.
JavaScript
Copy
const saveSeekDraftId = async (draftId, isComplete) => {
  // Save the draft ID alongside the job requisition in your software.
};

const handleSubmitButton = async () => {
  const result = await dispatchEvent('seek:questionnaire:save');

  if (result.isError) {
    // No draft ID will be provided if an error occurs.
    // The panel will display an actionable error message to the hirer.
    return;
  }

  await saveSeekDraftId(result.data.id, result.data.isComplete);
};

Resuming a draft

When the hirer resumes their job posting workflow from a saved draft, your software must pass the saved draftPositionProfileId as a prop to the render function.
JavaScript
Copy
const props = {
  jobRequisition: {
    // ...
    draftPositionProfileId: savedDraftId // The saved draft ID from your software
  }
};
SeekApi.render(containerNode, 'enhancedJobPosting', props);
Note that when the hirer saves changes to a draft job ad, a new draft ID will be returned. The previous draft ID can be safely discarded.

Querying draft details

You can retrieve a draft’s details with the draftPositionProfile query. This can be useful if your software displays a summary screen prior to posting the job ad.
GraphQL
query draftPositionProfile($id: String!) {
  draftPositionProfile(id: $id) {
    id
    positionTitle
    location {
      suburb
    }
    isComplete
  }
}

Previewing a draft

You can preview a draft job ad by calling the postedPositionProfilePreview query with the draftPositionProfileId.
QueryVariablesResult
query ($draftPositionProfileId: String!) {
  postedPositionProfilePreview(
    draftPositionProfileId: $draftPositionProfileId
  ) {
    previewUri {
      url
    }
  }
}
For further details on handling job ad previews, refer to Previewing a job ad.

Draft lifecycle

A draft job ad is created when the hirer saves their job ad within the Enhanced Job Posting panel. Each subsequent save event with any changes will return a new draft ID.A single draft ID can be posted as a SEEK job ad multiple times, or similarly used to resume editing from a specific point in time. This can allow your system to retain a draft ID as a template to streamline the creation of similar job ads in the future.Draft job ads are retained for 180 days from their last retrieval.