Recipe a: the general application
One set of terms for every application that names no position, a button with the job's words or none, and no API call per click.
3 minute read
The simplest integration: no API and no server for the button. Every application it makes is read on your general application's terms. A job board's own listings, or a plain Apply with certo on a careers page that names no job, an open application to your company.
1. Save the general terms
Under Integrations, Apply with certo, The general application, choose what an application lets you read and what the candidate should have ready: the kinds of record, contact details, the date of birth with its reason, the checklist. Save. The id of your general application, ao_ and 32 hex characters, is on the same page with the snippet.
Until the terms are saved, the button opens on apply.general_terms_missing.
2. Paste the button
<script src="https://certo.bio/apply/v1.js" async></script>
<button data-certo-apply="ao_6f1c2b8e4d7a49f0a3e5c1d2b9f8e7a6"
data-job-ref="JOB-42"
data-job-title="Backend engineer"
data-hiring-company="Acme Robotics"
data-job-url="https://jobs.hireline.example/job-42"
data-state="st-9d1e5c7a2b"></button>
An open application to your company, with no job:
<button data-certo-apply="ao_6f1c2b8e4d7a49f0a3e5c1d2b9f8e7a6" data-state="st-9d1e5c7a2b"></button>
| Attribute | What |
|---|---|
data-certo-apply | The id: ao_ here, ap_ for a position, as_ for an apply session. Required |
data-job-ref | Your reference for the job, at most 200 characters |
data-job-title | The job's title, at most 120 characters |
data-hiring-company | The hiring company, for a job board's listing, at most 120 characters |
data-job-url | The job's page, http or https, at most 2048 characters |
data-state | Your value for this visitor, at most 200 printable characters without spaces, quotes or angle brackets |
data-mode | popup (the default) or redirect (redirect mode) |
data-redirect-uri | Redirect mode's return address, one you registered |
The job's words are plain text, shown to the candidate as your words and kept on the application. certo never checks them. Too long, or with angle brackets or control characters, the popup answers apply.field_invalid.
The state. Make a fresh random value for each visitor, keep it in their session on your server, and put it in data-state. It comes back as the token's nonce and as state everywhere else, and your server compares the two. It is what ties the application to the visitor who pressed the button.
3. Or open it from your own button
document.querySelector('#apply').addEventListener('click', () => {
CertoApply.open({
id: 'ao_6f1c2b8e4d7a49f0a3e5c1d2b9f8e7a6',
jobRef: 'JOB-42',
jobTitle: 'Backend engineer',
hiringCompany: 'Acme Robotics',
jobUrl: 'https://jobs.hireline.example/job-42',
state: window.certoState,
onApplied(result) { /* client side: send result.token to your server */ },
onSubmitted({ applicationId, state }) { /* server side only */ },
onCancel(detail) { /* the candidate closed the popup, or it never opened */ },
})
})
Call CertoApply.open in the click handler itself: a browser blocks a popup opened later.
4. Receive it
- Client side:
onApplied(result)gets the application and its token. Send the token to your server and verify it there; never trust the JSON the page holds. - Server side only:
onSubmitted({ applicationId, state })tells the page it was sent, with no content. Your server hearsapplication.submittedand reads the application (server side).
A button in the HTML dispatches the same as DOM events, certo:applied, certo:submitted and certo:cancel, with the same detail:
const button = document.querySelector('[data-certo-apply]')
button.addEventListener('certo:applied', async (event) => {
await fetch('/certo/applied', {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({ token: event.detail.token }),
})
})
The same job again
A candidate who applies again to your company for the same job (the same job_ref, or with none, your open application) updates the application they already made: the same id, the terms of now, the same access. Your page receives it again; no second application.submitted is sent. Another job_ref is another application.