I am working on linkedin api and want to get user feeds from their profile.
I found share api for this but it is working for new post creation but it is not giving feeds.
I am using this rest api https://api.linkedin.com/v2/shares?q=owners&owners={URN}&sharesPerOwner=100
It is not returning user feeds
This Error Coming
Fatal error: Uncaught RuntimeException: Request Error: Not enough permissions to access: GET-owners /shares. Raw Response: Array ( [serviceErrorCode] => 100 [message] => Not enough permissions to access: GET-owners /shares [status] => 403 ) in /storage/ssd5/236/3070236/public_html/linkedin/sdk/LinkedIn.php:271 Stack trace: #0 /storage/ssd5/236/3070236/public_html/linkedin/sdk/LinkedIn.php(212): LinkedIn->_makeRequest('https://api.lin...', Array, 'GET', Array, Array) #1 /storage/ssd5/236/3070236/public_html/linkedin/sdk/LinkedIn.php(181): LinkedIn->fetch('https://api.lin...', Array) #2 /storage/ssd5/236/3070236/public_html/linkedin/feed.php(23): LinkedIn->get('/shares?', Array) #3 {main} thrown in /storage/ssd5/236/3070236/public_html/linkedin/sdk/LinkedIn.php on line 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));