Candidate -> set owner by API

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

Moderators: StaffingSupport, s.emmons, BullhornSupport

Post Reply
Arture
User
Posts: 4
Joined: Thu Sep 10, 2020 11:44 am

Candidate -> set owner by API

Post by Arture »

How to set the owner to the candidate with the API. I have already test with owner => ID and owner => array( 'id' => ID)

"entity/Candidate/" . $candidate_id;

)

[owner] => 27
)
stdClass Object
(
[errorMessage] => error persisting an entity of type: Candidate
[errorMessageKey] => errors.cannotPersistEntity
[errorCode] => 500
[errors] => Array
(
[0] => stdClass Object
(
[propertyName] => owner
[severity] => ERROR
[type] => IMPROPERLY_STRUCTURED_ASSOCIATION
)

)

[entityName] => Candidate
)
khenle
User
Posts: 7
Joined: Wed Feb 26, 2020 12:31 pm

Re: Candidate -> set owner by API

Post by khenle »

Hi,

You can set the owner field for a Candidate by using a valid CorporateUser ID when creating the Candidate.

CorporateUser is the primary owner of the Candidate. The default value is the user who creates the Candidate otherwise.

http://bullhorn.github.io/rest-api-docs ... #candidate
leonardosalatino
User
Posts: 9
Joined: Wed Jul 15, 2020 5:44 pm

Re: Candidate -> set owner by API

Post by leonardosalatino »

In my scenario the client had a particular user name that they wanted to set as owner. So, since it wasn't going to be duplicated, I was able to set it using the name field instead of the id:

owner.name = "That particular name"
Arture
User
Posts: 4
Joined: Thu Sep 10, 2020 11:44 am

Re: Candidate -> set owner by API

Post by Arture »

Unfortunately both suggestions tested but withour succes.

[address] => Array
(
[city] => Alblasserdam
[countryID] => 2306
)

[source] => Aanmelding op eigen website
[CorporateUser] => 27
)

stdClass Object
(
[changedEntityType] => Candidate
[changedEntityId] => 64961
[changeType] => UPDATE
[messages] => Array
(
[0] => stdClass Object
(
[detailMessage] => unknown property: CorporateUser
[propertyName] => CorporateUser
[severity] => WARNING
[type] => UNKNOWN_PROPERTY
)

)

Any suggestions? Is this maybe only available on creating Candidates? Can you give me an example of the Candidate data?

Thanx!
leonardosalatino
User
Posts: 9
Joined: Wed Jul 15, 2020 5:44 pm

Re: Candidate -> set owner by API

Post by leonardosalatino »

You are setting the prop CorporateUser but the structure is:

Code: Select all

{
   "owner": {
      "id": 1
      "name": "Leo"
   }
}
So, if you want to set the corporate user you have to populate one of the fields:
owner.name --> if you are using a name
owner.id --> if you are using an id
Post Reply