Page 1 of 1

Get all candidates - duplicates and omissions

Posted: Tue Oct 22, 2019 9:22 am
by tgallatin
I'm trying to use the API to pull down all of our candidates. I was able to successfully do this for jobOrders, Placements, etc by using the query API. Candidate only allows for me to do a search. When I do this and specify id:[* TO *] it brings back duplicates and when it's finished it has left out many. I can't figure out how to fix this. As of now, I have to do a dupe check and also run my code multiple times because the data seems to be random. I have ordered by +id, but the ids are definitely not ordered. After hours of running this, I still only have 108000 out of 142000 total candidates. Please advice. My url I'm using is (and I increment the start every loop through):

search/Candidate?showTotalMatched=true&start=0&count=66&query=id:[* TO *]&fields=id,name,firstName,middleName,lastName,nickName,gender,status,owner,comments,dateLastComment,customText5,desiredLocations,companyName,dateAvailable,source,customText4,customText12,referredBy,dateOfBirth,ssn,customText11,customText6,email,phone,mobile,phone2,preferredContact,address,secondaryAddress,primarySkills,specialties,categories,certifications,customText1,customText7,customText10,customDate3,dateAdded,isDeleted&orderBy=+id

Re: Get all candidates - duplicates and omissions

Posted: Mon Nov 04, 2019 11:03 am
by mholmemi
Hi,

This is Mikaela from Bullhorn Support.

I would advise using something like the below:
search/Candidate?query=isDeleted:0&fields=id,firstName,lastName,email,phone,status&sort=id&count=500&start=1&BhRestToken=xxxx

I hope this helps. Please let me know if you have any additional questions.

Re: Get all candidates - duplicates and omissions

Posted: Thu Nov 07, 2019 9:38 am
by tgallatin
Hi Mikaela,

I did that and it still doesn't give me all the records I need. Also, I had to use orderBy instead of sort and the max count I can get of candidates is 66. I have to run it multiple times, and with over 130,000 candidates this is not desirable. And even when I use orderBy, they aren't actually ordered by id.

Also, I tried specifically telling it which IDs I want but it appears to be a text search and not an actual ID search. For example, if I tell it I want IDs 1000 to 1100 it will bring back IDs 10500, 103000, etc.

All the other objects (jobOrder, jobSubmission, Placement, etc) I'm able to get fine but Candidate not so much.

Thanks!

Re: Get all candidates - duplicates and omissions

Posted: Thu Nov 07, 2019 11:25 am
by mholmemi
Hi tgallatin,

Can you please send me the call you made based on my recommendation of the below? I would also recommend your order by dateadded rather than ID.

search/Candidate?query=isDeleted:0&fields=id,firstName,lastName,email,phone,status&sort=id&count=500&start=1&BhRestToken=xxxx

Thanks,
Mikaela

Re: Get all candidates - duplicates and omissions

Posted: Wed Dec 04, 2019 10:05 am
by tgallatin
With Mikaela's help, I was able to figure it out. Turns out that orderBy is for queries and sort is for searches. So I switched orderBy to sort in my queryString and was able to do this correctly.

Re: Get all candidates - duplicates and omissions

Posted: Fri Jan 10, 2020 10:45 am
by mattick17
I am attempting to do something similar I would like to create validation on a ssn field interaction. the simplified version is I am attempting to use appBridge to reachout and find if the new ssn number already exists in the database in which case I can alert the user and direct them to the preexisting candidate. However I have had no success using ssn. I have seen articles that mention that is may be a confidential or encrypted field. Does this mean that what I'm attempting to do may be impossible?