简体   繁体   English

LinkedIn API-获取用户供稿

[英]LinkedIn API - Get User Feed

I am having trouble getting the feed of a users updates via the API. 我无法通过API获取用户供稿的更新。

I am authenticating just fine and am able to get the profile information but that is it.. 我进行身份验证就可以了,并且能够获取个人资料信息,仅此而已。

Code: 码:

$config['base_url'] = URL_FULL.'/networks.php?connect=3';   
$config['callback_url'] = URL_FULL.'/networks.php?connect=3&step=2'; 
$config['linkedin_access'] = LINKEDIN_KEY;
$config['linkedin_secret'] = LINKEDIN_SECRET;

$li = new LinkedIn(
  array(
    'api_key' => LINKEDIN_KEY, 
    'api_secret' => LINKEDIN_SECRET, 
    'callback_url' => $config['callback_url']
  )
);

$test = $li->setAccessToken($row['token']);
$info = $li->get('/people/~/network/updates');
print_r($info);

Error: 错误:

Fatal error: Uncaught exception 'RuntimeException' with message 'Request Error: Access to network denied. 致命错误:未捕获的异常“ RuntimeException”,消息为“请求错误:对网络的访问被拒绝。 Raw Response: Array( [errorCode] => 0 [message] => Access to network denied [requestId] => GDXQ1QTFSQ [status] => 403 [timestamp] => 1399293102543)' in /var/www/social/includes/LinkedIn/linkedin.php:292Stack trace:#0 /var/www/social/includes/LinkedIn/linkedin.php(229): LinkedIn->_makeRequest(' https://api.lin ...', Array, 'GET', Array, Array)#1 /var/www/social/includes/LinkedIn/linkedin.php(197): LinkedIn->fetch('/people/~/netwo...', Array)#2 /var/www/social/includes/requests/getPosts.php(192): LinkedIn->get('/people/~/netwo...')#3 {main} thrown in /var/www/social/includes/LinkedIn/linkedin.php on line 292 原始响应:Array([errorCode] => 0 [message] =>无法访问网络[requestId] => GDXQ1QTFSQ [status] => 403 [timestamp] => 1399293102543)'在/ var / www / social / includes / LinkedIn / linkedin.php:292堆栈跟踪:#0 /var/www/social/includes/LinkedIn/linkedin.php( 229 ):LinkedIn-> _ makeRequest(' https://api.lin ...',Array,' GET',数组,数组)#1 /var/www/social/includes/LinkedIn/linkedin.php(197):LinkedIn-> fetch('/ people /〜/ netwo ...',数组)#2 / var /www/social/includes/requests/getPosts.php(192):LinkedIn-> get('/ people /〜/ netwo ...')#3 {main}放在/ var / www / social / includes / LinkedIn中/linkedin.php在292行

EDIT: This problem still racks my brain! 编辑:这个问题仍然困扰着我!

The LinkedIn api has changed and the permissions also changed. LinkedIn api已更改,权限也已更改。 You should check the link for more information on the changes, in the past I faced the same problem. 您应该检查链接以获取有关更改的更多信息,过去我也遇到过同样的问题。

Permissions now are: 现在的权限是:

Your Profile Overview, Your Full Profile, Your Email Address, Your Connections, Your Contact Info, Network Updates, Group Discussions, Invitations and Messages, 您的个人资料概述,您的完整个人资料,您的电子邮件地址,您的联系方式,您的联系信息,网络更新,小组讨论,邀请和消息,

Here more info on recent changes in the LinkedIn api 这里是有关领英api最近更改的更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM