How to get client detail of job? URGENT ASAP?

Forum for users and developers of Bullhorn's Webservices API suite

Moderators: StaffingSupport, s.emmons, BullhornSupport

Post Reply
revinfotech1
User
Posts: 3
Joined: Mon Sep 05, 2011 4:54 am

How to get client detail of job? URGENT ASAP?

Post by revinfotech1 » Mon Sep 05, 2011 4:58 am

hi,

i am using API.. i want to fetch the client detail who posted the job.
Like all client detail and his email etc.. who posted the job.

my code


$request = array(
'username' => $username,
'password' => $password,
'apiKey' => $apiKey);

$API_session = $BHclient->startSession($request);
$API_currentSession = $API_session->return;

// Build the query
$req_query = array(
'entityName' => 'JobOrder',
'where' => "id>132237 order by id DESC",

);

$dto_query->query = new SoapVar($req_query, SOAP_ENC_OBJECT, NULL, NULL, "query");
$dto_query->session = $API_currentSession;

// Execute the query
try {
$response = $BHclient->query(new SoapVar($dto_query,XSD_ANYTYPE,'dtoQuery','http://query.entity.bullhorn.com'));
} catch (SoapFault $fault) {
// echo $BHclient->__getLastRequest();
// die($fault->faultstring);
}

$API_currentSession = $response->return->session;
$jobIds = $response->return->ids;

// Loop through the IDs returned by the query and display them in a table.






foreach ($jobIds as $value) {


$findRequest = array(
'session' => $API_currentSession,
'entityName' => 'JobOrder',
'id' => new SoapVar($value, XSD_INTEGER,'int','http://www.w3.org/2001/XMLSchema'),
'associationName' => 'JobCategory');
try {
$response = $BHclient->find($findRequest);
} catch (SoapFault $fault) {
echo $BHclient->__getLastRequest();
die($fault->faultstring);
}


$API_currentSession = $response->return->session;
$jobDto = $response->return->dto;


//echo $jobDto->title;
//echo "<br>";

echo "<br>";
echo "<br>";
echo $value;
echo "---";
print_r($jobDto);

echo "<br>";
echo "<br>";






}

jdonnelly
User
Posts: 192
Joined: Wed Feb 09, 2011 4:57 pm

Re: How to get client detail of job? URGENT ASAP?

Post by jdonnelly » Mon Sep 19, 2011 12:34 pm

Hello Revin,

Sorry for the delay. jobOrder entities have clientContactId and clientCorporationId properties that you can use to perform a find operation to retrieve the required info about either the clientContact info that you want or the clientCorporation info that you want. More information about the entities and their associations can be found here: http://developer.bullhorn.com/documentation. Please let me know if anything is not clear or if you have other questions.

Thanks,
Jon Donnelly
Technical Support Engineer
Developer Forum Admin
B U L L H O R N
support@bullhorn.com

Post Reply