1. Go to this page and download the library: Download usman/linkedinapi 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/ */
usman / linkedinapi 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..
*/
//er['name'];
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 Usman\LinkedInApi\LinkedIn('app_id', 'app_secret', 'xml');
// By setter
$linkedIn->setFormat('xml');
// Set format for just one request
$linkedIn->post('v2/people/~/shares', array('format'=>'xml', 'body'=>$body));
// By constructor argument
$linkedIn=new Usman\LinkedInApi\LinkedIn('app_id', 'app_secret');
$linkedIn->get('v2/userinfo');