Page 1 of 2

How to create a note via the REST API 02409991

Posted: Wed Mar 30, 2016 2:03 pm
by jkaashoek
The REST API is not totally explicit on how to create a Note. We have to make assumptions since the exact syntax of the REST call is not listed in the REST API reference document. I assumed that the rest call would use:

POST to url : https://rest9.bullhornstaffing.com/rest ... 58a56fdad3
And an (incomplete) JSON sample to post with it would be:
{ "id":"12345","comments":"This is a note"}

But we get an error: Unexpected HTTP status: 400, Bad Request
Response: {
"errorMessage" : "unknown or badly structured command: /entity/Note?BhRestToken=96dc2cad-8bbd-4826
-80d5-f958a56fdad3."

So the questions are:

- What is the url syntax?
- What pararameters should be passed in JSON? For instance the note id can not be specified normally

Re: How to create a note via the REST API

Posted: Thu Apr 07, 2016 9:52 am
by pmularski
Good Morning Jkaashoek,

In order to add a Note, you need to use a PUT command, not a POST. Can you retry your attempt, while using a PUT?

Re: How to create a note via the REST API

Posted: Fri Apr 08, 2016 4:00 pm
by jkaashoek
Using a PUT seems to work much better, thank you!

Re: How to create a note via the REST API

Posted: Fri Apr 08, 2016 5:07 pm
by jkaashoek
What we still need is an example of how to create a note for a candidate. The documentation is not complete as to what type each JSON element should have etc.

Here is a sample of something that does not work

{ "commentingPerson":2
,"candidates" : [4]
,"comments":"This is note"
,"personReference":
{ "id" : "2"}
}

org.apache.http.client.ClientProtocolException: Unexpected HTTP status: 500, Internal Server Error
Response: {
"errorMessage" : "error persisting an entity of type: Note",
"errors" : [ {
"propertyName" : "commentingPerson",
"severity" : "ERROR",
"type" : "IMPROPERLY_STRUCTURED_ASSOCIATION"
}, {
"propertyName" : "candidates",
"severity" : "WARNING",
"type" : "ATTEMPT_TO_SET_TO_MANY"
} ],
"entityName" : "Note"
}

Re: How to create a note via the REST API

Posted: Mon Apr 11, 2016 4:21 pm
by ColinC
Hello jkaashoek,

I have created a note from your setup by changing the formatting of the Json.
- commentingPerson and personReference are to-one associations so they should be setup like this
- candidates is a to-many association so the format itself is different since there is the ability to set the association to multiple records
- comments is a string so as you had it setup works fine.

The documentation has a list of every field on the notes entity near the bottom. If you click the name of the entity you wish to see in the table of contents it will take you to the page that the note entity starts on.

Code: Select all

{ 
"commentingPerson": { "id" : "2"},
"candidates" : [ 
            { "id" : "4"}
            ],
"comments":"This is note",
"personReference": { "id" : "2"}
}

Re: How to create a note via the REST API

Posted: Tue Apr 12, 2016 7:31 pm
by jkaashoek
Thanks, that makes the Notes creation work.

How to create a Appointment via the REST API

Posted: Thu Dec 08, 2016 5:43 am
by senthur123
Hi,

How to Pass guest value in Appointment Create Process.

Here is my sample Data:
{"guests":[{ "id" : "4"}],"subject":"API Test"}

Am facing Following Response :
"messages": [
{
"propertyName": "guests",
"severity": "WARNING",
"type": "ATTEMPT_TO_SET_TO_MANY"
}

Request for Notes REST API

Posted: Wed Jan 18, 2017 12:19 pm
by senthur123
Hi Bullhorn support,
Team, we need following API's to Integrate Vonage Bullhorn.

#1. Retrieve Message Template ( Note Template )
#2. Need Post API & format for set Distribution list while making Note Create API call.

Thanks
Senthur Pandi.S

Re: How to create a note via the REST API 02409991

Posted: Wed Jan 18, 2017 3:55 pm
by ColinC
Hi Senthur,

I am researching this with our team right now. I have more to run through and to reach out to our Tier 3 team. Once I hear back I will keep you updated.

Thank you,
Colin

Re: How to create a note via the REST API 02409991

Posted: Thu Jan 19, 2017 9:36 am
by senthur123
Thanks ColinC

Re: How to create a note via the REST API 02409991

Posted: Thu Jan 19, 2017 11:50 am
by ColinC
Hello again,

I worked with our Tier 3 team and have this worked out now.

In order to create an attendee you must use the appointmentAttendee entity and as such you are going to PUT one record in at a time. Below is an example:
PUT command
https://rest2.bullhornstaffing.com/rest-services/[Corp Token]/entity/AppointmentAttendee

Body:
{
"appointment":{"id":1234},
"attendee":{"id":12345},
"acceptanceStatus":0
}

Basically the order of creating a note and adding attendees through REST is:
1. Create the Appointment without Attendees
2. Create each Attendee separately attaching them to the appointment

Let me know if you have any further questions.

Re: How to create a note via the REST API 02409991

Posted: Fri Jan 20, 2017 9:17 am
by senthur123
Thanks ColinC,

Your are Reply Appointment Attendees API, But we need retrieve & post API for Notes Template in Bullhorn.

Thanks
Senthur Pandi.S

Re: How to create a note via the REST API 02409991

Posted: Fri Jan 20, 2017 10:11 am
by ColinC
Hi Senthur,

I'm not sure what you are requesting. You can do a meta call on notes or look at what fields are available on notes here:
http://developer.bullhorn.com/sites/def ... TAPI_0.pdf

I'm not sure what you are referring to as a note template. Could you elaborate?

Re: How to create a note via the REST API 02409991

Posted: Fri Jan 20, 2017 11:27 am
by senthur123
Hi,

Please check my screenshot

Re: How to create a note via the REST API 02409991

Posted: Fri Jan 20, 2017 4:06 pm
by ColinC
Ah, that. That cannot be accessed via our APIs. It is only accessible in-app.

They might be able to provide you with the contents of one then you can create it on your end and it will be effectively the same thing, however, updates will be manual. The template only fills in the note body. Not sure if this would work for your setup, but setting up note creation templates is possible from your end.

Kind regards,
Colin