Page 1 of 1

How to save a file with a candidate

Posted: Wed Mar 30, 2016 2:06 pm
by jkaashoek
What is the REST API call for saving a file (PDF) with a candidate record?

Re: How to save a file with a candidate

Posted: Thu Apr 07, 2016 10:34 am
by pmularski
Good Morning Jkaashoek,

Do you still require assistance on this issue?

Re: How to save a file with a candidate

Posted: Fri Apr 08, 2016 3:29 pm
by jkaashoek
Yes we have not found the API call(s) ourselves.
Thanks,

Joop

Re: How to save a file with a candidate

Posted: Mon Apr 11, 2016 4:27 pm
by ColinC
Hi jkaashoek,

A pdf will be done the same way that a word document would be parsed into the system. The main issue is that the pdf has selectable text that can be parsed. If the pdf is essentially an image file then it will not function properly.

Here is a link that runs through the entire process. The most commonly missed issue when running through this is that the body is setup as a multipart/form attachment when adding the file to be parsed.

http://developer.bullhorn.com/articles/ ... fromresume

Hope this helps.

Re: How to save a file with a candidate

Posted: Mon Apr 11, 2016 4:33 pm
by jkaashoek
Thanks for the info. Our PDF files contain images only so I guess they won't be uploadable.

Re: How to save a file with a candidate

Posted: Mon Apr 11, 2016 5:17 pm
by jkaashoek
So the posting of the raw file is not an option?

Attach the resume file to the candidate

To attach the original resume file to the Candidate entity, we call PUT /file/Candidate/{candidateId}/raw. We attach the .doc resume file to the request as a multipart/form attachment; in a browser form, this is <input type="file"/>.

Request URI:


PUT https://rest.bullhornstaffing.com/rest- ... {corpToken}
/file/Candidate/2038/raw?externalID=Portfolio&fileType=SAMPLE
The externalID and fileType parameters are required. For externalID, use Portfolio as the value. For fileType, use SAMPLE as the value.

Response:

Re: How to save a file with a candidate

Posted: Wed Apr 13, 2016 7:57 pm
by pmularski
Good Afternoon jkaashoek,

I apologize, but I do not understand your question. What are you trying to do specifically, and can you add your code for us to review?

Re: How to save a file with a candidate

Posted: Thu Apr 14, 2016 6:24 pm
by jkaashoek
We are trying to integrate an assessment service with Bullhorn, and to save PDF's of test results in a candidate profile. The PDF is not resume-related.

Re: How to save a file with a candidate

Posted: Thu Apr 14, 2016 6:35 pm
by srg.bdavis
We use a PUT command to attach a file to a candidate (not just resumes) but use the base64 option instead of the raw file. The uri looks like this -> /file/Candidate/{candidateId}. The json included with the body has the following fields:

fileContent = Base64 string representing the file content
externalID = portfolio
filename = file name
fileType = SAMPLE
description = file description
type = type of file (e.g. resume, writing sample, data sheet, etc.)
contentType = application/msword, application/pdf, etc.

This option should work fine for attaching your rest results.

Re: How to save a file with a candidate

Posted: Thu May 12, 2016 12:18 pm
by jkaashoek
A belated thank you, we got our PDF file postings to work.

Re: How to save a file with a candidate

Posted: Tue Sep 06, 2016 3:26 pm
by sdjukic
Hi, I have tried both approaches, targeting /raw and sending file as multipart/form-data content type, and also application/json with file content as encoded string as described here. I have added all other parameters as described, but each time I just get response 400 Bad Request. No other explanation what exactly is wrong. Does anybody have any hint how to localize what exactly am I not setting correctly in request? Thanks in advance!

Re: How to save a file with a candidate

Posted: Thu Sep 15, 2016 11:47 am
by lokuber
Hello @sdjukic , this may be to late but I could help you.
Are you using php or C# ?
Did you properly build your payload ?

Here are the parameters I use (php code) :

Code: Select all

params = array(
			'method'  		   => 'PUT', 
			'file'	  		   => $filename,
			'type'	  		   => 'Resume',
			'description'	   => 'Candidate Resume',
			'headers' 		   => array(
				'accept'       => 'application/json',
				'content-type' => 'multipart/form-data;boundary=' . $boundary,
			),
			'body'    => $payload,
		);

Re: How to save a file with a candidate

Posted: Tue Sep 20, 2016 3:51 pm
by sdjukic
Hello @lokuber, thanks for your answer!

I was actually working on other features, I still did not make this work. I am using Java / Spring and am instantiating Spring's RestTemplate class. I was trying to replicate all that I read here but I seem to be failing.

I see that header is a bit different then mine. I did not set "accept" part, and I am also missing "boundary", is this boundary mandatory? What would be value of boundary? I can paste Java code if it helps?

Thanks once again!

Re: How to save a file with a candidate

Posted: Wed Oct 05, 2016 3:17 am
by JameyGo
sdjukic wrote:Hello @lokuber, thanks for your answer!

I was actually working on other features, I still did not make this work. I am using Java / Spring and am instantiating Spring's RestTemplate class. I was trying to buy vigrx plus to replicate all that I read here but I seem to be failing.

I see that header is a bit different then mine. I did not set "accept" part, and I am also missing "boundary", is this boundary mandatory? What would be value of boundary? I can paste Java code if it helps?

Thanks once again!
Hi sdjukic, have you gotten it to work yet?

Re: How to save a file with a candidate

Posted: Thu Apr 18, 2019 5:23 pm
by JuanShuman
ColinIC wrote:
Wed Oct 13, 2432 9:24 am
Hi jkaashoek,

A pdf will be done the same way that a word document would be parsed into the system. The main issue is that the pdf has selectable text that can be parsed. If the pdf is essentially an image file then it will not function properly.

Here is a link that runs through the entire process. The most commonly missed issue when running through this is that the body is setup as a multipart/form attachment when adding the file to be parsed.

http://developer.bullhorn.com/articles/ ... fromresume

Hope this helps.
The 'Save Candidate configuration' will overwrite the previously.