JobSubmission 500

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

Moderators: StaffingSupport, s.emmons, BullhornSupport

Post Reply
michaelcurry
User
Posts: 1
Joined: Sun Apr 19, 2015 3:02 pm

JobSubmission 500

Post by michaelcurry » Sun Apr 19, 2015 3:16 pm

When attempting to add a candidate to a job, a response of 500 is being returned. I can not find anything in the documentation about this issue. Below is the information about the request being made. Please let me know if there is any more information needed to help with the debugging process.

The information used to create this request is found here: http://developer.bullhorn.com/articles/ ... candidates

Endpoint:

Code: Select all

PUT https://rest5.bullhornstaffing.com/rest-services/{ID}/entity/JobSubmission?BhRestToken={token}
Body:

Code: Select all

{
    "candidate": {
        "id": 252745
    },
    "jobOrder": {
        "id": 14753
    },
    "status": "New Lead",
    "dateWebResponse": 1429470562245
}
Response:

Code: Select all

{
    "status": 500,
    "error": "JSON Processing Problem: Unexpected character ('c' (code 99)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\n at [Source: java.io.BufferedReader@26f50be5; line: 1, column: 2]"
}

s.emmons
User
Posts: 333
Joined: Wed Dec 31, 1969 8:00 pm

Re: JobSubmission 500

Post by s.emmons » Fri May 01, 2015 11:47 am

Hi Michael,

It looks like something got into the body of the request improperly. This worked for me in Postman:

Code: Select all

{
"candidate": {"id": 2589},
"jobOrder": {"id": 97},
"status": "New Lead",
"dateWebResponse": 1430496000000
}
Sam Emmons
Enterprise Team Lead
BULLHORN
US Support 617-478-9126

FeintEars
User
Posts: 3
Joined: Sat Jul 25, 2015 5:55 pm

Re: JobSubmission 500

Post by FeintEars » Sat Jul 25, 2015 6:02 pm

michaelcurry, if you use PHP CURL, just note that PHP's cURL API is not particularly intuitive.

You might think that because a POST request body is sent using the following option that a PUT request would be done the same way:

Code: Select all

// works for sending a POST request
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

// DOES NOT work to send a PUT request
curl_setopt($ch, CURLOPT_PUT, 1);
curl_setopt($ch, CURLOPT_PUTFIELDS, $data);
Instead, to send a PUT request (with associated body data), you need the following:

Code: Select all

// The correct way to send a PUT request
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
I had the same problem and that was helpful for me.
See: http://stackoverflow.com/questions/1171 ... p-and-curl

Post Reply