This content provides an early look at an upcoming extension to the SEEK API. You may use it to scope integration effort, but the features described are not fully implemented and may be adjusted ahead of a production release.Check with your SEEK contact before starting any build work described here.
dispatchEvent('seek:draft:save').
It returns a Promise to a result object.
dispatchEvent('seek:draft:save') does not throw or reject.| 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);
};
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);
draftPositionProfile query.
This can be useful if your software displays a summary screen prior to posting the job ad.QueryVariablesSuccess resultError result
CopyGraphQL Explorer
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
}
}postedPositionProfilePreview query with the draftPositionProfileId.
Preview renders the saved draft without mutating the draft or posting a job.GraphQLVariablesSuccess resultError result
CopyGraphQL Explorer
query ($draftPositionProfileId: String!) {
postedPositionProfilePreview(
draftPositionProfileId: $draftPositionProfileId
) {
previewUri {
url
}
}
}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