2012-05-29 101 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