Page 1 of 1

Update Candidate no longer working

Posted: Tue Jan 07, 2020 10:45 pm
by DaveNorthCreek
Hello Bullhorn,

It's been a long time but I am responding to a request from an old client to get their Bullhorn integration working again.

I've got custom PHP code that logs in successfully and submits Candidate information using POST. Up until I looked at the latest docs, the format I used was:

Code: Select all

https://rest60.bullhornstaffing.com/rest-services/[corpcode]/entity/Candidate/[candidate_id]?BhRestToken=[redacted]
I see that in the latest api docs, the /[candidate_id] is no longer needed in the POST request. I removed that and it helped me get to the next error, which is:

Code: Select all

{
  ["errorMessage"]=>
  string(65) "Invalid entity used. Valid entities are: JobSubmission, Placement"
  ["errorMessageKey"]=>
  string(36) "errors.entity.override.invalidEntity"
  ["errorCode"]=>
  int(400)
}
I don't see any mention of this error or any reason why Candidates are not valid entities to update. Can anyone help?

It may be obvious to those of you that are up to date with Bullhorn, but I put all my learning time in several years ago and my consulting practice has moved on from Bullhorn so I freely admit I'm out of date.

Thanks,
DaveNorthCreek

Re: Update Candidate no longer working

Posted: Wed Jan 08, 2020 5:00 pm
by bashen
I don't believe the Candidate ID is optional in the POST URL.

What was your original error when you included the Candidate ID in the URL?

Re: Update Candidate no longer working

Posted: Thu Jan 09, 2020 11:16 am
by DaveNorthCreek

Code: Select all

{
  ["errorMessage"]=>
  string(35) "No valid input data found to parse."
  ["errorMessageKey"]=>
  string(21) "errors.noInputToParse"
}
The only change between the two errors was the removal of the candidate ID. It makes sense that something that major would not change without a lot of noise here and in the documentation. This error message is not very helpful however.

Re: Update Candidate no longer working

Posted: Thu Jan 09, 2020 11:17 am
by DaveNorthCreek
I'd post the JSON but it is full of PII about some random candidate. It is valid JSON as assembled by PHP.

Re: Update Candidate no longer working

Posted: Thu Jan 09, 2020 6:09 pm
by bashen
"No valid input data found to parse"

This is the error you get if the POST body is completely empty. If it was invalid JSON you would get something like a "JSON Processing Error" instead. I would check to make sure however you're sending the POST request is including the JSON body.

Re: Update Candidate no longer working

Posted: Thu Jan 16, 2020 10:27 am
by BramEsposito
I ran into the same issue.

Explicitly setting the "Content-Type: text/plain" header seems to solve the issue. cURL seems to set the 'Content-Type: application/x-www-form-urlencoded' by default.

Re: Update Candidate no longer working

Posted: Fri Jan 17, 2020 4:03 pm
by DaveNorthCreek
So the Candidate ID is indeed still required for updates.

The change that was made that appears to have fixed the problem is to explicitly set the Content-Type to "Application/JSON".

Once that was done the update ran with no errors. This must have been a validation check that was added to Bullhorn but not documented.

Hopefully Bullhorn learns its lesson from this and publishes changes to its public API somewhere visible!