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 or reject.

Result object

| Result property | Type | Description | | :---------------- | :-------- | :-------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | | isError | boolean | Whether an error has occurred. | | errorCode | string | The kind of error. One of validationFailed or mutationFailed.Only present when isError is true. | | errorMessage | string | A non-empty message that your software should show to the hirer.Only present when isError is true. | | data | object | null | An object that contains information about the draft job ad.Present when isError is false. | | data.id | string | The ID of the newly persisted immutable draft. | | 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, data.id will contain the saved draft’s ID. After every successful save, replace the stored draft ID with this new ID. The draft can then be posted with postPositionFromDraft if it is create-scoped, or used with updatePositionProfileFromDraft if it is edit-scoped. See post a draft job ad for more information.An incomplete or invalid form does not create a draft. It returns isError: true with errorCode validationFailed.
errorCode
Meaning
validationFailed
Visible form data is invalid.
mutationFailed
The create-draft mutation failed to save the draft job ad.
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, but if the panel is not in view when the save button is shown consider using errorMessage to inform the hirer of errors they should fix.
JavaScript
Copy
const saveSeekDraftId = async (draftId) => {
  // Replace the stored draft ID alongside the job requisition in your software.
};

const handleSubmitButton = async () => {
  const result = await dispatchEvent('seek:draft: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);
};

Resuming a draft

When the hirer resumes their job posting workflow from a saved draft, your software must pass the saved draftPositionProfileId as a top-level prop to the render function. Continue to pass the current job requisition as the position prop. To resume an edit-scoped draft, also pass the live job’s positionProfileId.
JavaScript
Copy
const props = {
  getAuthToken,
  position,
  draftPositionProfileId: savedDraftId
};
SeekApi.render(containerNode, 'enhancedJobPosting', props);
Every separate successful save, including a save with unchanged values, returns a new draft ID. 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.
QueryVariablesSuccess resultError result
query draftPositionProfile($id: String!) {
  draftPositionProfile(id: $id) {
    seekDraftPositionId {
      value
    }
    seekReadyToPostIndicator
    seekDraftPositionOpening {
      postingRequester {
        id {
          value
        }
      }
      statusCode
    }
    positionTitle
    positionOrganizations {
      id {
        value
      }
      name
    }
    seekHirerJobReference
    seekBillingReference
    positionFormattedDescriptions {
      content
      descriptionId {
        value
      }
    }
    offeredRemunerationPackage {
      basisCode
      descriptions
      ranges {
        intervalCode
        minimumAmount {
          currency
          value
        }
        maximumAmount {
          currency
          value
        }
      }
    }
    seekAnzWorkTypeCode
    jobCategories {
      id {
        value
      }
      name
    }
    positionLocation {
      id {
        value
      }
      name
    }
    seekWorkArrangementCodes
    seekDraftApplicationQuestionnaire {
      components {
        id {
          value
        }
        componentTypeCode
        ... on DraftApplicationQuestion {
          questionHtml
        }
        ... on DraftApplicationPrivacyConsent {
          privacyPolicyUrl {
            url
          }
        }
      }
    }
    seekVideo {
      url
      __typename
    }
    postingInstructions {
      seekAdvertisementProducts {
        id {
          value
        }
      }
      branding {
        id {
          value
        }
        name
      }
      end
      applicationMethods {
        applicationUri {
          url
        }
      }
    }
    seekPartnerMetadata
  }
}

Previewing a draft

You can preview a draft job ad by calling the postedPositionProfilePreview query with the draftPositionProfileId. Preview renders the saved draft without mutating the draft or posting a job.
GraphQLVariablesSuccess resultError result
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. There is no update-in-place operation. Each subsequent save after the previous save settles, including a save with unchanged values, returns a new draft ID.A create-scoped draft ID can post one or more new SEEK job ads with postPositionFromDraft. An edit-scoped draft ID can update only its source live job with updatePositionProfileFromDraft.Draft job ads are retained for 180 days from their most recent successful authorized retrieval.Draft-read failures use these HTTP statuses:
  • missing, expired, or otherwise invalid token: 401
  • valid token without the required operation scope: 403
  • valid scoped token with a hirer or partner mismatch: 404