People Search web service PHP example
The following PHP code example enables you to easily get up and running with the People Search web service. Simply use the authentication credentials supplied to you on sign up which we have made available to you in the My Account section.
You will likely prefer to use one of of the available OAuth libraries to handle client authentication. Our example below makes use of PHP's OAuth extension.
Whilst our code examples demonstrate the breadth of our capabilities, all of our examples are created using demo data and do not contain real or live personal data relating to data subjects.
<?php $subject = array( 'name1' => 'Heather Russell', 'dob1' => '', 'name2' => '', 'location' => 'BS7', 'alias' => '1', 'strictMiddle' => '1', 'withoutDOB' => '1', 'withInitial' => '1', 'requestReference' => 'My Unique Reference', ); // Your consumer key and secret as supplied by Tracesmart $consumerKey = 'b8e601941ad09b9478ac76c25b3bb46e10b8bdad'; $consumerSecret = '3065d6fa76t2da717bc5765388a8795a45245583'; try { $oauth = new OAuth( $consumerKey, $consumerSecret, OAUTH_SIG_METHOD_HMACSHA1, OAUTH_AUTH_TYPE_AUTHORIZATION ); // This is a live API, please contact us if you need to perform load, volume or security testing $oauth->fetch('https://api.tracesmart.co.uk/peoplesearch/v1/match', $subject); $serviceResponse = $oauth->getLastResponse(); } catch(OAuthException $e) { echo "Service Response: ". $e->getMessage() . PHP_EOL; } // Your People search results are now ready to work with $peoplesearchResult = json_decode($serviceResponse);
From this juncture you should refer to the higher level documentation which explains how to send a request.