Happyr / LinkedIn-API-client

A library to connect with LinkedIn API. Perfect if you are looking for an API client or SDK for LinkedIn
MIT License
198 stars 97 forks source link

Invalid access token. When trying to post to wall #163

Open ahab1b opened 6 years ago

ahab1b commented 6 years ago

Using composer: Yes I have authenticated login with the following script

if ($linkedIn->isAuthenticated()) { //we know that the user is authenticated now. Start query the API $user=$linkedIn->get('v1/people/~:(firstName,lastName)'); echo "Welcome ".$user['firstName']; exit(); } elseif ($linkedIn->hasError()) { echo "User canceled the login."; exit(); }

//if not authenticated $url = $linkedIn->getLoginUrl(); echo "Login with LinkedIn";

I get the Welcome message. Now when I run the code you specified to post to a wall. I get Invalid Access Token message. Even though it's been authenticated.

array(5) { ["errorCode"]=> int(0) ["message"]=> string(21) "Invalid access token." ["requestId"]=> string(10) "MRJ7OAOB2U" ["status"]=> int(401) ["timestamp"]=> int(1532269505084) }