Request · TypeScript/api/v3/parser
// Runs in your upload service, never in the browser
const form = new FormData()
form.append('file', new Blob([cvBuffer]), fileName)
form.append('application_id', application.id)
const res = await fetch('https://onlineresumeparser.com/api/v3/parser', {
method: 'POST',
headers: { 'X-API-Key': process.env.HIRELAYER_API_KEY! },
body: form,
})
if (res.status === 422) {
// DOCUMENT_NOT_A_RESUME, DOCUMENT_UNREADABLE, DOCUMENT_TEXT_EMPTY…
const { code } = await res.json()
return askApplicantForAnotherFile(code)
}
const cv = await res.json()
await candidates.update(application.id, {
fullName: cv.info_candidate.full_name,
email: cv.info_candidate.email,
currentTitle: cv.info_candidate.job_title,
seniority: cv.info_candidate.experience_level,
history: cv.work_experiences,
languages: cv.languages,
resumeText: cv.info_resume.text,
})