Get entity required fields for creating new entity

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

Moderators: StaffingSupport, s.emmons, BullhornSupport

Post Reply
grantholle
User
Posts: 3
Joined: Thu Oct 10, 2019 8:36 am

Get entity required fields for creating new entity

Post by grantholle » Sun Oct 20, 2019 4:19 am

Sorry if this has been answered, but no matter how I search, the ignored words include "required fields entity new", so... cannot find any results for that.

I need to get the required fields for creating an entity, regardless of type. I can see `meta/{entityType}` with full meta, but the fields it says is required doesn't match what's actually required when sending a request.

An example is a Candidate like in the docs example. I can create a Candidate by only providing `firstName` and `lastName` (like in the docs), but when retrieving the meta for Candidate fields, it says `email` and `employeeType` among others are also required. Just providing `firstName` and `lastName` is sufficient to create a Candidate.

There are meta fields `required` and `optional`, however how can something be both required and optional? Which takes precedence? In the Candidate example, both `firstName` and `lastName` are required but also optional.

sellingham
User
Posts: 2
Joined: Fri Nov 08, 2019 9:30 am

Re: Get entity required fields for creating new entity

Post by sellingham » Fri Nov 08, 2019 9:46 am

According to the API docs, optional is supposed to represent nullability, and required comes from the field mappings. The problem is as you've found the API doesn't seem to care a lot of the time, and happily accepts data that doesn't appear to be valid based on the available meta information.

It actually gets better - if you explicity send a null value for an optional field, it comes back with an error that a required property is not set, but if instead you don't specify that field at all, then the request is accepted without errors and succeeds!

Then there are other gotchas: creating a Candidate with just a firstName and lastName works fine, but that can't be edited via the Bullhorn UI as clicking the name - that hasn't been set - is the only way to get into the edit screen; there's no way to all entities of a given type; there's no way to find out how many entries there are in an options list; etc.

Working with this API is proving to be quite painful.

Post Reply