1. Go to this page and download the library: Download net-shell/linkedin-api library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
net-shell / linkedin-api example snippets
/**
* This demonstrates how to authenticate with LinkedIn and send api requests
*/
/*
* First you need to make sure you've used composers auto load. You have is probably
* already done this before. You usually don't bother..
*/
//Welcome ".$user['firstName'];
exit();
} elseif ($linkedIn->hasError()) {
echo "User canceled the login.";
exit();
}
//if not authenticated
$url = $linkedIn->getLoginUrl();
echo "<a href='$url'>Login with LinkedIn</a>";
// By constructor argument
$linkedIn=new Happyr\LinkedIn\LinkedIn('app_id', 'app_secret', 'xml');
// By setter
$linkedIn->setFormat('xml');
// Set format for just one request
$linkedIn->get('v1/people/~:(firstName,lastName)', array('format'=>'xml'));