Handling Address Wheres

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

Moderators: StaffingSupport, s.emmons, BullhornSupport

Post Reply
Posts: 1
Joined: Wed Feb 22, 2017 5:58 pm

Handling Address Wheres

Post by caucusdigital »

Looking at this PHP, how do we handle the Where on the State Inside an address?

Code: Select all

$restcallurl = $resturl . 'query/JobBoardPost?BhRestToken=' . $BhRestToken . '&fields=id,title,address,startDate,status,clientCorporation,dateAdded&where=isOpen=true&address={state="Colorado"}';
What am I missing here?
Posts: 24
Joined: Tue May 03, 2016 1:47 pm

Re: Handling Address Wheres

Post by dfuller »

Hi Caucusdigital,

I'm Dan with Bullhorn Support and I'll be assisting you on this issue.

So there's a few things here. First, you're much better off doing a search rather than a direct query on this. Your URL (taken from our test environment, your corp token and cluster number would be different), should look something like:

https://rest2.bullhornstaffing.com/rest ... y=isOpen:1 AND address.state:"Colorado"&fields=*&count=30&start=0

You don't want to use an ampersand as part of your search statement because this will cause REST to think it's a second parameter. It should use the word AND or OR. Any time you're dealing with a composite or nested field like address, when searching the field will be the parent name (address) and then the specific field (state) that you're looking for. In this case, address.state:"Colorado".

Warm regards,
Dan Fuller | Enterprise Support Analyst
Post Reply