03077867: POST /resume/parseToHrXml

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

Moderators: StaffingSupport, s.emmons, BullhornSupport

fjdev1
User
Posts: 7
Joined: Wed Jan 10, 2018 2:38 pm

03077867: POST /resume/parseToHrXml

Postby fjdev1 » Thu Feb 08, 2018 6:16 pm

Hello!

Quick question for anyone to take a stab at - any insight would be extremely appreciated.

I'm trying to parse a PDF resume file using the Bullhorn REST API resume/parseToHrXml endpoint, but am having some trouble.
Here is my existing, relevant code:

Code: Select all

$boundary = uniqid();
$delimiter = '-------------' . $boundary;

$postfields = array('file' => 'http://www.bellevue.edu/student-support/career-services/pdfs/resume-samples.pdf');

$options = array(
   CURLOPT_RETURNTRANSFER => 1,
   CURLOPT_POST => true,
   CURLOPT_POSTFIELDS => $postfields,
   CURLOPT_HTTPHEADER => array(
      "Content-Type: multipart/form-data; boundary=" . $delimiter
   )
);

$ch = curl_init($restUrl.'resume/parseToHrXml?format=pdf&BhRestToken='.$BhRestToken);
curl_setopt_array($ch, $options);
$content = curl_exec($ch);
curl_close($ch);
debug_to_browser_console($content);


An error that is returning looks something like this:

Code: Select all

{
  "errorMessage" : "No File Uploaded!!",
  "errorMessageKey" : "errors.noFileInRequest",
  "errorCode" : 400
}


I'm not really sure how to format the POST request to the Bullhorn API, so any help would be greatly appreciated. I am just passing in some test PDF right now for the Bullhorn API to parse and return.

MikeCogle
User
Posts: 5
Joined: Mon Sep 12, 2016 10:23 am

Re: 03077867: POST /resume/parseToHrXml

Postby MikeCogle » Mon Feb 19, 2018 11:16 am

Hi fjdev1,

Whilst unfortunately, Bullhorn Support are not able to directly torubleshoot your PHP code, I can recommend some suggestions which will hopefully help moving forward.

Firstly, I've successfully made this call using Postman (https://www.getpostman.com/) which is our recommended API test platform. A screenshot of my successful attempt can be found below:

Image

I achieved this by setting the body to form-data, and then declaring the multipart/form-data as the chosen file. Once you've run this in postman, you can press the "code" button in the top right (highlighted in the above image) which will let you view the code needed to reproduce this functionality in different languages, including PHP with cURL. If you can action this on your side, this will hopefully give you the steps needed to complete this on your side.

We also have an example of /resume/parseToHrXml with cURL on our documentations page: http://bullhorn.github.io/rest-api-docs/#post-resume-parsetohrxml, which I've used successfully with the below call:

curl -X POST "https://restX.bullhornstaffing.com/rest-services/XXXX/resume/parseToHrXml?format=pdf&BhRestToken=38226fac-2683-4957-89e0-6bd538962916" -F "file=@XXXX\resume-samples.pdf"

Image

I hope the above helps.

Kind Regards,

Mike
Mike Cogle | Bullhorn Support | Senior Enterprise Support Analyst


Return to “REST API”

Who is online

Users browsing this forum: No registered users and 5 guests