Jump to content

PHP connection to LinkedIn


ArticSun

Recommended Posts

Hi all!

 

  I'm trying to retreive my own status updates from LinkedIn, but without success uptill now.

 

I did setup an oAuth communication which resulted in requesting the user for permission for the application to access his profile and I retrieved an access token succefully which I saved in the database.

 

However, when I try the following after that, using the access token:

$options = array(
  'consumerKey' => '[key here]',
  'consumerSecret' => '[secret here]',
);

// This is where I get the token, not really interesting 
$dbSocialAccount = new SocialAccount();
$oSocialAccount = $dbSocialAccount->fetchRow('id = "3"');

$token = unserialize($oSocialAccount->token);
$client = $token->getHttpClient($options);

$client->setUri('https://api.linkedin.com/v1/people/~');
$client->setMethod(Zend_Http_Client::GET);
$response = $client->request();
$content = $response->getBody();

echo 'content:<br /><br />';
echo $content;
exit();

 

It works fine! I get some profile information of the user/my own linkedin account.

Now I want to retrieve the last, say 5, updates from my own account, so I change the request URL to:

 

http://api.linkedin.com/v1/people/~/network/updates?scope=self

 

Which should get me all my own updates... however now I get an error:

 

401 1303487627487 0 [unauthorized]

 

I don't understand why I'm not authorized now? I do have access I guess, when the first example works?

What am I doing wrong here?

 

Thank you for your answer! If you need more information, please ask!

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.