2
votes

I'm actually working on displaying my company updates as a feed on my website.

I've created an App on LinkedIn and I'm able to get my security token and list info related to my profile by using the : "https://api.linkedin.com/v1/people/ME".

However, when I'm trying to retrieve my company updates using a GET call on : "https://api.linkedin.com/v1/companies/".$company_id."/updates". I'm getting a :

"Member does not have permission to get company." in the HTTP response message.

Configuration set :

  • I'm correctly listed as Admin on my company's page
  • "rw_company_admin" is enabled on my LinkedIn App
  • My App status is set to "Live"
  • My company ID is the correct one (I've double checked already)
  • My token is properly issued and I'm correctly identified by the app

Here is the code I'm using in the PHP method to get the updates :

public function getCompanyUpdates($company_id, $start=0,$count = 20){
		if(!$company_id)return false;
		$params['url'] = "https://api.linkedin.com/v1/companies/".$company_id."/updates";
		$params['method']='get';
		$params['args']['format']='json';
		if($start != 0 )$params['args']['start']=$start;
		if($count != 0 )$params['args']['count']=$count;
		$params['args']['event-type']='status-update';
		$result =  $this->makeRequest($params);
		return json_decode($result,true);
	}

I'm probably missing a step somewhere, but I've no idea where..

In advance, thanks a lot for your help!!

1
Here is an additional info, I'm also passing the scopes during the "getAuthorizeUrl" with this code : $scope = array('rw_company_admin','r_basicprofile','r_emailaddress','w_share'); $connect_link = $LIOAuth->getAuthorizeUrl($client_id,$redirect_url,$scope); - R. Couturier

1 Answers

0
votes

I fixed the error some weeks ago, but forgot to post the answer that fixes the issue.

My errors : - At first, I forgot to pass the scope while requesting the Token - After fixing this, I forgot to re-issue a new Token to get the scope applied

To conclude, it was just an oversight from me.

However, the LinkedIn API is a bit shitty, as it requires to refresh the Token periodically. It should be simplified when we only want to list Public updates that everyone can access.

Cheers