Get candidate file
To be able to retrieve a file from a candidate, you will need to do two operations.
- Retrieve a list of all files available for the desired candidate
- Use this details to ask for each file
Retrieve a list of available files on a candidate
To obtain the necessary details to be able to download/retrieve each file, you will need to do a GET of candidates with the field files
. More information about how to do a candidate lookup, please see our Candidate section in the sidebar menu.
Here is an example GET on how to retrieve candidates with file-lists:
https://api.recman.no/v2/get/?key=YOUR_KEY&scope=candidate&fields=files&page=1
This will list 500 candidates per page, with a list of available files per candidate. The files-object will not return if the candidate has no files. Below you will see a typical response, where two candidates has files, and 1 has not.
{
"success": true,
"numRows": 3,
"data": {
"982575": {
"candidateId": "982575",
"corporationId": "409",
"files": [
{
"fileId": "2106644",
"name": "CV Johnny Appleseed.pdf",
"created": "2017-12-18 10:43:53",
"type": "file"
}
]
},
"1086636": {
"candidateId": "1086636",
"corporationId": "409"
},
"1263621": {
"candidateId": "1263621",
"corporationId": "409",
"files": [
{
"fileId": "2017132",
"name": "Resume Jane Smith.pdf",
"created": "2017-11-11 12:10:34",
"type": "file"
}
]
}
}
}
If you want to retrieve the file list for a specific candidate you can do so by adding the parameter candidateId
https://api.recman.no/v2/get/?key=YOUR_KEY&scope=candidate&fields=files&candidateId=982575&page=1
Retrieving the files
Retrieving files are done 1 file per request. To do so you will need to include both candidateId
and fileId
, which you can receive from the request explained above.
URL | https://api.recman.no/v2/get/ |
scope | candidateFile |
candidateId | The ID of candidate |
fileId | The file ID |
Example | https://api.recman.no/v2/get/?key=YOUR_KEY&scope=candidateFile&candidateId=982575&id=2106644 |
All files are returned with the name of the file, the file extension type and a base64 string containing the file data.
{
"success": true,
"numRows": 1,
"data": {
"fileId": 2106644,
"base64":"JVBERi0xLjMKJcsdcs2sfvs.....",
"extension":"pdf",
"name":"cv kristoffer.pdf"
}
}