Select Website 

Recruitment Directory's Blog - Australia's #1 Recruitment Technology Blog!

Back to Menu Back to Menu

Adlogic Webservice API

Posted By: Thomas Shaw, 7:30am Monday 01 November 2010    Print Article

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 Request




SOAP 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
<?PHP // set webservice API $wsdl_url = 'http://www.adlogic.com.au/AdlogicJobPortalService?WSDL'; // connect to the webservice $getJobDetails = new SoapClient($wsdl_url, array('trace' => 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 = '<ul>'; } if (strlen($xml->BulletPoints->BulletPoint[0]) > 0) { $bulletpoints .= '<li>'.$xml->BulletPoints->BulletPoint[0].'</li>'; } if (strlen($xml->BulletPoints->BulletPoint[1]) > 0) { $bulletpoints .= '<li>'.$xml->BulletPoints->BulletPoint[1].'</li>'; } if (strlen($xml->BulletPoints->BulletPoint[2]) > 0) { $bulletpoints .= '<li>'.$xml->BulletPoints->BulletPoint[2].'</li>'; } if ((strlen($xml->BulletPoints->BulletPoint[0]) > 0) || (strlen($xml->BulletPoints->BulletPoint[1]) > 0) || (strlen($xml->BulletPoints->BulletPoint[2]) > 0)) { $bulletpoints .= '</ul>'; } echo '<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <style type="text/css"> body, td, p { font-size: 12px; font-family: Arial, Helvetica, sans-serif; color: #000000; } </style> </head> <body> <table width="460px" style="border: 1px solid #000000;" cellpadding="0" cellspacing="0"> <tr> <td><div style="margin:20px; font-size:18pt; line-height:normal">'.$xml->JobTitle.'</div> <div style="margin:20px;">'.$bulletpoints.$xml->JobDescription.'</div> <div style="margin:20px;"><a href="'.$xml->Enquiry->ApplicationURL.'"><strong>APPLY NOW</strong> </a></div></td> </tr> </table> </body> </html>'; ?>
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

Comments Hide Comments (0)

Feel free to join in on the conversation. All comments are moderated before publishing. Comments posted by subscribers don't necessarily reflect the views of Recruitment Directory.

Your Name: * Required
Your Email Address: * Required
Website URL:
Comments: * Required
Refresh
Enter the code you see in the image above (case sensitive). Click on the image to refresh it.
 


Back to Menu Back to Menu



Random Blog Articles

Australian HR Tech Report
Published: 11:17am Monday 29 March 2010

jobs.govt.nz igovt login system
Published: 5:30pm Tuesday 15 December 2009

RCSA needs your help
Published: 11:17pm Sunday 31 May 2009

Plan for the worst
Published: 6:37pm Wednesday 28 July 2010

Facebook Ad Credits
Published: 3:32pm Saturday 17 January 2009