Page 1 of 1

Creating a Candidate

Posted: Thu Aug 01, 2013 1:43 pm
by fyaconiello
I am creating a candidate record and having trouble setting the CountryID for the new candidate.

See: http://developer.bullhorn.com/sites/def ... TAPI_0.pdf the Candidate section has this about Candidate address and it doesn't mention Country anywhere.
address
Address Candidate's address.
This is an
address object containing
Street Address, City, State, and
Zip.

Re: Creating a Candidate

Posted: Fri Aug 16, 2013 9:39 am
by mpeterson
I will update the documentation to list the subfields of the address field, including countryID.

To set countryID, you first want to make a meta/Candidate?fields=address(countryID) call to see what the possible values are. These values are based on the Candidate field map. You'll get a response like this:
{
"entity" : "Candidate",
"entityMetaUrl" : "http://https://rest.bullhorn.com/e999/r ... te?fields=*",
"label" : "Candidate",
"fields" : [ {
"name" : "address",
"type" : "COMPOSITE",
"dataType" : "Address",
"label" : "fullAddress",
"fields" : [ {
"name" : "countryID",
"type" : "SCALAR",
"dataType" : "Integer",
"label" : "CountryID",
"options" : [ {
"value" : 1,
"label" : "Country1"
}, {
"value" : 2,
"label" : "Country2"
} ]
} ]
} ]
}

Once you know the countryID you want to use, you can include it in the body of your POST /entity/Candidate call, like this:
{
"firstName": "test",
"lastName": "test",
"name": "test",
"username": "test",
"address": {
"address1" : "test",
"address2" : "test",
"city" : "New York",
"state" : "NY",
"zip" : 12345,
"countryID" : 1
}
}