2012-05-29 99 views

回答

3

有沒有辦法在此時創建LinkedIn爲公司提供的「共享」。 Here is a post on their forums與此有關。

+1

此答案不再有效。請參閱http://stackoverflow.com/a/29607219/682673 – Andy

1

這是一個非常快速的指南。看看我使用LinkedIn API做出的決定。請記住,在此之前:

  1. 您必須在LinkedIn中有個人簡介;
  2. 貴公司必須在LinkedIn上有一個公司頁面(http://www.linkedin.com/company/yourcompanyname);
  3. 您必須是公司頁面的管理員(以便代表公司發佈更新)。

當滿足上述條件時,請轉至https://www.linkedin.com/secure/developer並使用您的個人資料憑據登錄。添加新應用程序以獲取API密鑰,密鑰,OAuth用戶令牌和OAuth用戶密鑰。

的LinkedIn API的PHP代碼在你的身邊後公司股份:

require 'OAuth.php'; // .. or install the PECL extension.. Google it 

$apiKey = 'xxxxxxx'; // take it from your application 
$apiSecret = 'yyyyyyyyy'; // take it from your application 
$accessToken = 'zzzzzzzzz'; // take it from your application 
$accessToken = 'kkkkkkkkkkk'; // take it from your application 
$oauth = new OAuth($apiKey, $apiSecret); 
$oauth->setToken($accessToken, $accessTokenSecret); 

$body = new stdClass(); 
$body->comment = 'Some comment'; 
$body->content = new stdClass(); 
$body->content->title = 'Some title'; 
$body->content->description = 'Some description'; 
$body->content->{'submitted-url'} = 'http://www.mycompany.com/article_id/123456'; // ID of your company page in LinkedIn 
$body->visibility = new stdClass(); 
$body->visibility->code = 'anyone'; 
$body_json = json_encode($body); 

$oauth->fetch('http://api.linkedin.com/v1/companies/12345678/shares', $body_json, OAUTH_HTTP_METHOD_POST, array(
    "Content-Type" => "application/json", 
    "x-li-format" => "json" 
)); 
$response = json_decode($oauth->getLastResponse()); 

我希望它能幫助。

+0

完全新手問題 - 我可以在哪裏下載Oauth.php的副本? –

1

截至2013年8月,LinkedIn的API支持與公司頁面共享。

Announcement

Official documentation

+0

現在這兩個鏈接都已損壞。 LinkedIn似乎刪除了他們所有的歷史博客文章,而現在只有兩篇文章詳細介紹了開發者計劃的變化。 WTG LinkedIn! – Andy