ashwinks / PHP-LinkedIn-SDK

A PHP wrapper for the LinkedIn API
94 stars 74 forks source link

Unable to work with library #21

Open melnikovic opened 8 years ago

melnikovic commented 8 years ago

Hey, I'm having problem with using this library at all,

I basicly just added this at start: include 'LinkedIn.php';

$li = new LinkedIn\LinkedIn( array( 'api_key' => 'api_KEY', 'api_secret' => 'API_SECRETone', 'callback_url' => 'http://localhost/xampp/linkedin/' ) );

which throw now error, but as soon as I try do something else like: $token = $li->getAccessToken($_REQUEST['code']);

Error dispaly: Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Invalid authorization code. Pass in the "code" parameter from your callback url' in

testchik commented 7 years ago

You needs to make two file one for display login and another for call back url. In second file needs to call $token = $li->getAccessToken($_REQUEST['code']);