How to save a file with a candidate

Forum for users and developers of Bullhorn's API service.

Moderators: StaffingSupport, s.emmons, BullhornSupport

Post Reply
jkaashoek
User
Posts: 18
Joined: Fri Feb 05, 2016 8:03 pm

How to save a file with a candidate

Post by jkaashoek » Wed Mar 30, 2016 2:06 pm

What is the REST API call for saving a file (PDF) with a candidate record?

pmularski
Bullhorn Support Staff
Posts: 927
Joined: Wed Dec 31, 1969 8:00 pm

Re: How to save a file with a candidate

Post by pmularski » Thu Apr 07, 2016 10:34 am

Good Morning Jkaashoek,

Do you still require assistance on this issue?
Patrick Mularski
Senior Enterprise Support Analyst
B U L L H O R N
Staffing and Recruiting Software, On Target, On Demand
Bullhorn Support Contact Numbers
US: 617-478-9126
UK: 44 800 032 2848
Australia: 61 28 073 5089
International: 617-478-9131

jkaashoek
User
Posts: 18
Joined: Fri Feb 05, 2016 8:03 pm

Re: How to save a file with a candidate

Post by jkaashoek » Fri Apr 08, 2016 3:29 pm

Yes we have not found the API call(s) ourselves.
Thanks,

Joop

ColinC
User
Posts: 67
Joined: Fri Apr 08, 2016 4:54 pm

Re: How to save a file with a candidate

Post by ColinC » Mon Apr 11, 2016 4:27 pm

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.
Colin Coffman
Enterprise Support Analyst
B U L L H O R N
Staffing and Recruiting Software, On Target, On Demand
617-478-9126 (US Support)
+44 800 032 2848 ext. 9131 (UK Support)

jkaashoek
User
Posts: 18
Joined: Fri Feb 05, 2016 8:03 pm

Re: How to save a file with a candidate

Post by jkaashoek » Mon Apr 11, 2016 4:33 pm

Thanks for the info. Our PDF files contain images only so I guess they won't be uploadable.

jkaashoek
User
Posts: 18
Joined: Fri Feb 05, 2016 8:03 pm

Re: How to save a file with a candidate

Post by jkaashoek » Mon Apr 11, 2016 5:17 pm

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:

pmularski
Bullhorn Support Staff
Posts: 927
Joined: Wed Dec 31, 1969 8:00 pm

Re: How to save a file with a candidate

Post by pmularski » Wed Apr 13, 2016 7:57 pm

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?
Patrick Mularski
Senior Enterprise Support Analyst
B U L L H O R N
Staffing and Recruiting Software, On Target, On Demand
Bullhorn Support Contact Numbers
US: 617-478-9126
UK: 44 800 032 2848
Australia: 61 28 073 5089
International: 617-478-9131

jkaashoek
User
Posts: 18
Joined: Fri Feb 05, 2016 8:03 pm

Re: How to save a file with a candidate

Post by jkaashoek » Thu Apr 14, 2016 6:24 pm

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.

srg.bdavis
User
Posts: 67
Joined: Thu Feb 20, 2014 4:52 pm

Re: How to save a file with a candidate

Post by srg.bdavis » Thu Apr 14, 2016 6:35 pm

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.

jkaashoek
User
Posts: 18
Joined: Fri Feb 05, 2016 8:03 pm

Re: How to save a file with a candidate

Post by jkaashoek » Thu May 12, 2016 12:18 pm

A belated thank you, we got our PDF file postings to work.

sdjukic
User
Posts: 5
Joined: Tue May 24, 2016 4:11 pm

Re: How to save a file with a candidate

Post by sdjukic » Tue Sep 06, 2016 3:26 pm

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!

lokuber
User
Posts: 35
Joined: Wed Jul 20, 2016 5:20 am

Re: How to save a file with a candidate

Post by lokuber » Thu Sep 15, 2016 11:47 am

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,
		);

sdjukic
User
Posts: 5
Joined: Tue May 24, 2016 4:11 pm

Re: How to save a file with a candidate

Post by sdjukic » Tue Sep 20, 2016 3:51 pm

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!

JameyGo
User
Posts: 1
Joined: Tue Oct 04, 2016 6:21 am

Re: How to save a file with a candidate

Post by JameyGo » Wed Oct 05, 2016 3:17 am

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?

JuanShuman
User
Posts: 1
Joined: Thu Apr 18, 2019 5:20 pm
Contact:

Re: How to save a file with a candidate

Post by JuanShuman » Thu Apr 18, 2019 5:23 pm

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.

Post Reply