Tying "ToMany" data back to parent Entity.

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

Moderators: StaffingSupport, s.emmons, BullhornSupport

Post Reply
jweber
User
Posts: 9
Joined: Fri Oct 09, 2020 7:51 am

Tying "ToMany" data back to parent Entity.

Post by jweber »

For data extraction purposes, we'd like to be able to:
  1. Get data for all Candidates from the RestAPI without the "ToMany" fields. (We know how to do this and works great)
    Get all data for the "ToMany" entities: (Skill, BusinessSector, Location...etc..) (We know how to do this, however... see 3.)
    Get the parent id's for the "ToMany" data so we can later tie them back to the Candidates. (We are stuck here. Is this possible?)
I'm aware, I can just grab the full Candidate objects with all the ToMany fields included, but this severely limits how many Candidate entities I can grab at a time (I can only grab 8 at a time because there are 25 ToMany fields and the total (Entities X ToManyFields) must be less than 200) which in turn makes the performance of the data extraction un-manageable.

Would love some help on this.

Thanks in advance.
bbagwell
User
Posts: 32
Joined: Wed Feb 26, 2020 12:17 pm

Re: Tying "ToMany" data back to parent Entity.

Post by bbagwell »

Hi jweber,

"Get the parent id's for the "ToMany" data so we can later tie them back to the Candidates. (We are stuck here. Is this possible?)"

Do you have an example of what you are looking for with this call? For Example, placements is a to-many field and lists the unique ID's of all placements associated with the candidate.
jweber
User
Posts: 9
Joined: Fri Oct 09, 2020 7:51 am

Re: Tying "ToMany" data back to parent Entity.

Post by jweber »

Do you have an example of what you are looking for with this call? For Example, placements is a to-many field and lists the unique ID's of all placements associated with the candidate.
Ultimately, we want to get Candidate data including all the "ToMany" data for all Candidates.

Search can only bring back a max of 10 "ToMany" entities, so that will not work.

The REST API allows us to get all the "ToMany" data for a Candidate if we go after it for each Candidate/"ToMany" field individualy:
.../entity/Candidate/1234/toManyEntity?fields=*

This last approach works and we get all the data, but it is VERY slow. For each Candidate we have to make 25 or so API calls to get data for each of the "ToMany" fields.

What we would like to do, for performance reasons (less calls to the REST API) is the following:

1. Get all the Candidate data for ALL the Candidates WITHOUT the "ToMany" data.
2. For each "ToMany" field, get all the Data for the "ToMany" field and get the relationship data between the "ToMany" field and the Candiate. (we want to make this call for ALL candidates at once not individually for each)

EXAMPLE:
Candiates
1 Joe
2 Fred
3 Saly

Placements
1 Business1
2 Business 2
3 Business 3

Relationship
CandiateId PlacementId
1 1
2 1
2 3
3 2
etc.....

I don't have insight into how the Bullhorn data is structured, so if there is a better way to do what we are trying to do I'm all ears. :-)

If all of this is confusing, let me just ask the question as follows:
Using the REST API, what is the most performant way to get all Candidate data including "ToMany" fields.

-Jeff
ggaragiola
User
Posts: 31
Joined: Wed Feb 26, 2020 12:43 pm

Re: Tying "ToMany" data back to parent Entity.

Post by ggaragiola »

Jeff,

This is Grant from Bullhorn Support.

We have some documentation here on To-many Associations:

http://bullhorn.github.io/rest-api-docs ... sociations

But the max is 10 for to many.

Your question on how to get the to many fields without doing to many might be possible using "()"

http://bullhorn.github.io/rest-api-docs/#entity-fields

The above documentation goes through this but an example would be something lke this:

/entity/Candidate/1234/?fields=categories(id)

Thank you
jweber
User
Posts: 9
Joined: Fri Oct 09, 2020 7:51 am

Re: Tying "ToMany" data back to parent Entity.

Post by jweber »

Hi Grant. I think this will help me but I have a follow up question.

I noticed, when I make a call like this:

/entity/Candidate/1234/?fields=categories(id)

It only brings back 4 category ids.

After some experimenting I found I can do this:

/entity/Candidate/1234/?fields=categories[25](id)

And it'll return up to 25 categories.

I want to always return all ids for the ToMany fields. My plan right now is to just use a very large number in the query:

/entity/Candidate/1234/?fields=categories[100000000](id) as that seems to always bring back everything.

My question: Is there better syntax to indicate I want all ToMany items? I tried [*] but that did not work.

Also are there limits to how many "ToMany" items can be returned with this call?
ggaragiola
User
Posts: 31
Joined: Wed Feb 26, 2020 12:43 pm

Re: Tying "ToMany" data back to parent Entity.

Post by ggaragiola »

Hello,

Using a large number will be best. We are no longer allowing "*" queries in API calls so choosing a large number is the best method. There is no limit but there is a limit on the amount that can be mass updated which is 10,000.

Thank you,
Post Reply