Recruitment Directory's Blog - Australia's #1 Recruitment Technology Blog!
Adlogic has released a webservice API which has opened up their internal system for 3rd party developers to build websites and applications from. They have also released a number of pre-built scripts allowing recruiters/employers to easily integrate their job board with the new webservice API.
I've been lucky enough to be using and testing the new API for the past few months now and it's very easy to pull client job ads in real time instead of waiting for a XML file to be send through. Besides building a script to search and view jobs. More functions are expected to be added to the webservice including subscribing users to job alerts and posting job applications back into Adlogic.
In this example I will show you how to display a requested job ad via the system. You will need to understand SOAP and XML. SOAP is the communication method for accessing a webservice.
First we need to understand the types of requests Adlogic has available. We are going to use "createXMLToViewAd" with a test jobAdId and it will return the job ad in a XML structure. In that example below we will look at the
SOAP envelope calls.
SOAP RequestSOAP Response
Now we understand what the return XML looks like, we can now script the request. In this example I am writing it in PHP. PHP 5 includes inbuilt SOAP and XML classes.
PHP Code 1));
// pass in the parameters
$searchParams = array('jobAdId' => 3968303);
// call the method
$wsResults = $getJobDetails->createXMLToViewAd($searchParams);
// return results
$jobreturn = $wsResults->return;
// read the XML and design the job ad
$xmlRaw = iconv("UTF-8","UTF-8//IGNORE",$jobreturn);
$xml = simplexml_load_string($xmlRaw);
// check string length of each bulletpoint. If yes, display
if ((strlen($xml->BulletPoints->BulletPoint[0]) > 0)
|| (strlen($xml->BulletPoints->BulletPoint[1]) > 0)
|| (strlen($xml->BulletPoints->BulletPoint[2]) > 0))
{ $bulletpoints = ''; }
if (strlen($xml->BulletPoints->BulletPoint[0]) > 0)
{ $bulletpoints .= '- '.$xml->BulletPoints->BulletPoint[0].'
'; }
if (strlen($xml->BulletPoints->BulletPoint[1]) > 0)
{ $bulletpoints .= '- '.$xml->BulletPoints->BulletPoint[1].'
'; }
if (strlen($xml->BulletPoints->BulletPoint[2]) > 0)
{ $bulletpoints .= '- '.$xml->BulletPoints->BulletPoint[2].'
'; }
if ((strlen($xml->BulletPoints->BulletPoint[0]) > 0)
|| (strlen($xml->BulletPoints->BulletPoint[1]) > 0)
|| (strlen($xml->BulletPoints->BulletPoint[2]) > 0))
{ $bulletpoints .= '
'; }
echo '
'.$xml->JobTitle.'
'.$bulletpoints.$xml->JobDescription.'
|
';
?>
PHP Output
Article URL: http://www.recruitmentdirectory.com.au/Blog/adlogic-webservice-api-a408.html
Article Tags: adlogic.com.au job ads adlogic webservice xml job board api soap adlogic webservice api recruitment website Hide Comments (0)