Php 如何使用API发布LinkedIn公司状态更新?
是否可以使用PHP通过API调用更新公司页面中链接的公司状态,目前无法为公司创建LinkedIn所称的“共享”。与此相关。这是一个非常快速的指南。看看我使用LinkedIn API的决定。在此之前,请记住:Php 如何使用API发布LinkedIn公司状态更新?,php,api,linkedin,Php,Api,Linkedin,是否可以使用PHP通过API调用更新公司页面中链接的公司状态,目前无法为公司创建LinkedIn所称的“共享”。与此相关。这是一个非常快速的指南。看看我使用LinkedIn API的决定。在此之前,请记住: 你必须在LinkedIn中拥有个人资料 您的公司必须在LinkedIn()中有公司页面 您必须是公司页面的管理员(才能代表公司发布更新) 满足上述条件后,转到并使用您的个人资料凭据登录。添加新应用程序以获取API密钥、密钥、OAuth用户令牌和OAuth用户密钥 您发布公司股票的Linked
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());
我希望它能有所帮助。从2013年8月起,LinkedIn的API支持共享到公司页面
.此问题的公认答案不再有效,另一个链接到该问题现在可用的公告的答案有两个断开的链接
为了澄清,您现在可以发布公司状态更新/共享,相关文档位于全新问题-我在哪里可以下载Oauth.php副本?此答案不再有效。请看两个链接现在都断开了。LinkedIn似乎删除了他们所有的历史博客文章,现在只有两篇详细介绍了他们开发程序的变化。WTG LinkedIn!