我正在使用linkedin API,并希望从其个人资料中获取用户供稿。
我为此找到了共享api,但是它可以用于创建新帖子,但没有提供供稿。
我正在使用此rest api https://api.linkedin.com/v2/shares?q=owners&owners= {URN}&sharesPerOwner = 100
它不返回用户供稿
此错误即将发生
致命错误:未捕获RuntimeException:请求错误:没有足够的权限访问:GET所有者/共享。原始响应:/ storage / ssd5 / 236/3070236 / public_html / linkedin / sdk /中的数组([serviceErrorCode] => 100 [message] =>没有足够的权限访问:GET所有者/ shares [status] => 403) LinkedIn.php:271堆栈跟踪:#0 /storage/ssd5/236/3070236/public_html/linkedin/sdk/LinkedIn.php(212):LinkedIn-> _ makeRequest('https://api.lin ...',数组, 'GET',数组,数组)#1 /storage/ssd5/236/3070236/public_html/linkedin/sdk/LinkedIn.php(181):LinkedIn->fetch('https://api.lin ...',数组) #2 /storage/ssd5/236/3070236/public_html/linkedin/feed.php(23):LinkedIn-> get('/ shares?',Array)#3 {main}扔到/ storage / ssd5 / 236/3070236 /public_html/linkedin/sdk/LinkedIn.php,第271行
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
session_start();
include('sdk/LinkedIn.php');
$li = new LinkedIn(
array(
'api_key' => '78n8rt9drtjjjjxfke',
'api_secret' => 'WrCvccbvcbvcbcvb7oT',
'callback_url' => 'http://example.com/linkedin/demo.php'
)
);
$url = $li->getLoginUrl(
array(
LinkedIn::SCOPE_BASIC_PROFILE,
LinkedIn::SCOPE_EMAIL_ADDRESS,
LinkedIn::SCOPE_WRITE_SHARE,
)
);
$token = $li->setAccessToken($_SESSION['access_token']);
$profile = $li-
>get('/shares?',array('q'=>'owners','owners'=>'urn:li:person:jG_fgrgrrgri','sharesPerOwner'=>100));