Get a candidate's CV document, by candidate ID. Returns either a URL, or binary data of the CV document, depending on the provider.
npm i @superfaceai/one-sdk
const { SuperfaceClient } = require('@superfaceai/one-sdk');
// You can manage tokens here: https://superface.ai/insights
const sdk = new SuperfaceClient({ sdkAuthToken: '<< Login to get your token >>' });
async function run() {
// Load the profile
const profile = await sdk.getProfile('recruitment/get-cv@1.0.0');
// Use the profile
const result = await profile
.getUseCase('GetCV')
.perform({
candidateId: 'CANDIATE_ID'
}, {
provider: 'mock'
});
// Handle the result
try {
const data = result.unwrap();
console.log(data);
} catch (error) {
console.error(error);
}
}
run();
{
"candidateId": "CANDIATE_ID"
}
{
"cv": {
"createdAt": "2023-01-05T10:04:58.325Z",
"document": {
"fileName": "cv.pdf",
"content": "<BinaryData>"
}
}
}