Using a date range with Candidates’ dateAdded field

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

Moderators: StaffingSupport, s.emmons, BullhornSupport

bahi
User
Posts: 22
Joined: Sun Jun 08, 2014 8:09 pm
Location: London, UK
Contact:

Using a date range with Candidates’ dateAdded field

Postby bahi » Fri Jun 02, 2017 3:06 am

This search, starting 1st Jan 2016, returns me 33,000+ results:

Code: Select all

dateAdded:[2016-01-01T00:00:00+00:00 TO 2017-05-31T00:00:00+00:00]


Changing the start date from 1st Jan 2016 to 1st Jan 2017 gets me zero results, though we add tens of candidates a day. No other search constraints for this search query—just the date range search against one field.

Code: Select all

/search/Candidate?query=dateAdded:[2017-01-01T00:00:00+00:00 TO 2017-05-31T00:00:00+00:00]&fields=firstName,lastName,email,dateAdded,source


Similar results if I search against dateLastModified.

Index problem, perhaps? I’ve looked at the date range posts here and the format above does appear to work, and it works for me if I search from 1st Jan 2016. I’ve also tried regular Unix timestamps instead of the ISO 8601 format with similar results. Likewise, using double-quotes around the date values and leaving out the time offset. Suggestions welcome!

I originally posted this in an earlier thread but though it deserved its own. Apologies for the repetition. Would be most grateful for any suggestions, as always.

Thanks

Bahi

ColinC
User
Posts: 56
Joined: Fri Apr 08, 2016 4:54 pm

Re: Using a date range with Candidates’ dateAdded field

Postby ColinC » Fri Jun 02, 2017 11:04 am

Hi Bahi,

This is Colin with Bullhorn Support. I used the format you used and also got 0 results. I took a look at how the system runs this sort of query and it returned this:
/search/Candidate?query=dateAdded:[20170101060000 TO 20170602045959] &fields=firstName,lastName,email,dateAdded,source

With that change in dateAdded format it returned the proper records. Could you give that a try?

Thanks,
Colin
Colin Coffman
Enterprise Support Analyst
B U L L H O R N
Staffing and Recruiting Software, On Target, On Demand
617-478-9126 (US Support)
+44 800 032 2848 ext. 9131 (UK Support)

bahi
User
Posts: 22
Joined: Sun Jun 08, 2014 8:09 pm
Location: London, UK
Contact:

Re: Using a date range with Candidates’ dateAdded field

Postby bahi » Fri Jun 02, 2017 2:12 pm

ColinC wrote:I took a look at how the system runs this sort of query and it returned this:
/search/Candidate?query=dateAdded:[20170101060000 TO 20170602045959] &fields=firstName,lastName,email,dateAdded,source

With that change in dateAdded format it returned the proper records. Could you give that a try?


Spot on, Colin—that worked perfectly. Much appreciated!

The format I was using appears to be part of the spec for the /query call and not for /search.

Very happy that that’s working. Now for the other end—creating the WP user records! I’m a bit more familiar with that side of it.

Many thanks

Bahi


Return to “REST API”

Who is online

Users browsing this forum: No registered users and 4 guests

cron