Best way to get all candidates?

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

Moderators: StaffingSupport, s.emmons, BullhornSupport

mfowler
User
Posts: 8
Joined: Thu May 25, 2017 8:30 am

Best way to get all candidates?

Postby mfowler » Fri May 26, 2017 10:34 am

In this question viewtopic.php?f=104&t=23776
srg.bdavis gave a great answer for how to get all notes for a given candidate

I am now looking for how to get a list of all candidates (name and ids).

It looks like query (used for notes) is not supported for Candidate.

What is the best way to get Candidates? Is there a good way to iterate through all results on the entity end point?

Thanks for any help.

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

Re: Best way to get all candidates?

Postby srg.bdavis » Fri May 26, 2017 4:42 pm

The search GET should return what you need. It would look something like this:

/search/Candidate?query=isDeleted:0&fields=name,id&start=0&count=500

The response will include an object containing 4 fields -> total, start, count, and data. Data will be the array of candidates returned. The total field is what you will use for your iteration. For example if you send the search above and the total is 687, the data array will contain the first 500. Your next query would have the start parameter as 501.

What I have done in the past is to check the count value after each call. If it equals 500, I make another call. If its less than 500 I know I'm done.

Brent

mfowler
User
Posts: 8
Joined: Thu May 25, 2017 8:30 am

Re: Best way to get all candidates?

Postby mfowler » Mon May 29, 2017 8:31 am

I will try this out, thanks!


Return to “REST API”

Who is online

Users browsing this forum: No registered users and 4 guests

cron