Added notes to a candidate

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

Moderators: StaffingSupport, s.emmons, BullhornSupport

pbearne
User
Posts: 19
Joined: Thu Mar 31, 2016 1:36 pm

Added notes to a candidate

Postby pbearne » Fri May 26, 2017 11:34 am

Hi Guys

I need to add a message from a web submission to the newly created candidate.

using this post as an example viewtopic.php?f=104&t=22925&p=68295&hilit=notes#p68295

get an Unknown or badly structured command: /entity/Note/. error

It looks right to me. :-)

What am I doing wrong?

Details below

Paul

Body: string(121) "{"comments":"test message","commentingPerson":{"id":328852},"candidates":[{"id":328852}],"personReference":{"id":328852}}"
URL: string(116) "https://rest34.bullhornstaffing.com/rest-services/kmk9/entity/Note/?BhRestToken=4b7cc1a5-f7ae-4e26-ba9a-f39573317985"
Response: array(6) {
["headers"]=>
object(Requests_Utility_CaseInsensitiveDictionary)#1253 (1) {
["data":protected]=>
array(7) {
["server"]=>
string(17) "Apache-Coyote/1.1"
["access-control-allow-methods"]=>
string(31) "GET, POST, PUT, DELETE, OPTIONS"
["access-control-max-age"]=>
string(5) "86400"
["access-control-allow-headers"]=>
string(33) "Content-Type, X-Requested-With, *"
["access-control-allow-origin"]=>
string(1) "*"
["content-type"]=>
string(30) "application/json;charset=UTF-8"
["date"]=>
string(29) "Fri, 26 May 2017 15:35:57 GMT"
}
}
["body"]=>
string(119) "{
"errorMessage" : "Unknown or badly structured command: /entity/Note/.",
"errorMessageKey" : "errors.badCommand"
}"
["response"]=>
array(2) {
["code"]=>
int(400)
["message"]=>
string(11) "Bad Request"
}
["cookies"]=>
array(0) {
}
["filename"]=>
NULL
["http_response"]=>
object(WP_HTTP_Requests_Response)#1256 (5) {
["response":protected]=>
object(Requests_Response)#1258 (10) {
["body"]=>
string(119) "{
"errorMessage" : "Unknown or badly structured command: /entity/Note/.",
"errorMessageKey" : "errors.badCommand"
}"
["raw"]=>
string(495) "HTTP/1.1 400 Bad Request
Server: Apache-Coyote/1.1
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Max-Age: 86400
Access-Control-Allow-Headers: Content-Type, X-Requested-With, *
Access-Control-Allow-Origin: *
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Fri, 26 May 2017 15:35:57 GMT
Connection: close

{
"errorMessage" : "Unknown or badly structured command: /entity/Note/.",
"errorMessageKey" : "errors.badCommand"
}"
["headers"]=>
object(Requests_Response_Headers)#1250 (1) {
["data":protected]=>
array(7) {
["server"]=>
array(1) {
[0]=>
string(17) "Apache-Coyote/1.1"
}
["access-control-allow-methods"]=>
array(1) {
[0]=>
string(31) "GET, POST, PUT, DELETE, OPTIONS"
}
["access-control-max-age"]=>
array(1) {
[0]=>
string(5) "86400"
}
["access-control-allow-headers"]=>
array(1) {
[0]=>
string(33) "Content-Type, X-Requested-With, *"
}
["access-control-allow-origin"]=>
array(1) {
[0]=>
string(1) "*"
}
["content-type"]=>
array(1) {
[0]=>
string(30) "application/json;charset=UTF-8"
}
["date"]=>
array(1) {
[0]=>
string(29) "Fri, 26 May 2017 15:35:57 GMT"
}
}
}
["status_code"]=>
int(400)
["protocol_version"]=>
float(1.1)
["success"]=>
bool(false)
["redirects"]=>
int(0)
["url"]=>
string(116) "https://rest34.bullhornstaffing.com/rest-services/kmk9/entity/Note/?BhRestToken=4b7cc1a5-f7ae-4e26-ba9a-f39573317985"
["history"]=>
array(0) {
}
["cookies"]=>
object(Requests_Cookie_Jar)#1236 (1) {
["cookies":protected]=>
array(0) {
}
}
}
["filename":protected]=>
NULL
["data"]=>
NULL
["headers"]=>
NULL
["status"]=>
NULL
}
}

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

Re: Added notes to a candidate

Postby srg.bdavis » Fri May 26, 2017 2:09 pm

Paul,

Can you post your original request (is it a PUT or a POST)? Normally that 400 code is returned when you try to create an entity and specify a field name that does not exist. At first glance, the field names in your request body appear to be ok.

Thanks!
Brent

pbearne
User
Posts: 19
Joined: Thu Mar 31, 2016 1:36 pm

Re: Added notes to a candidate

Postby pbearne » Mon May 29, 2017 8:25 am

Sorry Yes this is a PUT request

I retesting in postman to make sure with same results

Paul

pbearne
User
Posts: 19
Joined: Thu Mar 31, 2016 1:36 pm

Re: Added notes to a candidate

Postby pbearne » Mon May 29, 2017 8:49 am

while we are looking at this the ask from the client is add a note from the application web form to the candidate in Bullhorn so is it OK to use the candidate id for all the fields?

DaveNorthCreek
User
Posts: 68
Joined: Fri Nov 20, 2015 2:04 pm

Re: Added notes to a candidate

Postby DaveNorthCreek » Wed May 31, 2017 7:11 pm

My code to do exactly this only has ["comments"] and ["personReference"]["id"], no other fields. Otherwise it's a PUT to entity/Note, so just try stripping down your Note to just comments and personReference->id and see if that works. I remember much pain around Note submission, so I'm glad to help another pilgrim on this road.


Return to “REST API”

Who is online

Users browsing this forum: Google [Bot] and 2 guests