领英公司供稿 [英] LinkedIn Company Feed

查看:107
本文介绍了领英公司供稿的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是LinkedIn公司页面https://www.linkedin.com/company/{id}/的所有者和管理员.

我想连接到LinkedIn,并获得一个JSON提要,该JSON提要在我的公司墙上显示最新的10条帖子,以便显示在我的网站上,因此我触摸了服务https://api.linkedin.com/v1/companies/{id}/updates?format=json.

JSON在linkedin.php中输出.然后将此文件包含在我的网页中,例如index.php.

我已经在 https://developer.linkedin.com 注册了一个应用.我已经在PHP-LinkedIn-SDK中输入了我的客户端ID和客户端密钥,可在此处 https://github.com上找到. com/ashwinks/PHP-LinkedIn-SDK .

我遵循了需要首先进行身份验证的开发人员文档.当我运行linkedin.php时,我被重定向到登录我的LinkedIn个人资料.我必须完成此步骤才能触摸上面的服务.

使用当前解决方案时,我的用户访问我的网站时必须登录LinkedIn.

如何在不提示用户登录的情况下访问公司的LinkedIn帖子列表?

谢谢.

解决方案

1.生成您的访问令牌 请遵循文档 https://github.com/ashwinks/PHP-LinkedIn-SDK 来创建一个登录链接.

2.保存您的访问令牌 一旦获得,它将可以使用60天.将其保存到数据库中.

3.获取您的公司帖子 您可以使用相同的访问令牌来获取公司内容

$li = new LinkedIn(...);
$li->setAccessToken(YOUR_ACCESS_TOKEN);
$posts = $li->get('/companies/YOUR_COMPANY_ID/updates/');

4.管理回复 解析后缓存或显示响应.

希望有帮助,

I am the owner and admin of a LinkedIn company page: https://www.linkedin.com/company/{id}/.

I want to connect to LinkedIn and get return a JSON-feed with latest 10 posts on my company wall to display on my website so I touch on the service https://api.linkedin.com/v1/companies/{id}/updates?format=json.

The JSON is outputted in linkedin.php. This file is then included in my web page, say index.php.

I have registrered an app at https://developer.linkedin.com. I have entered my Client ID and Client Secret in PHP-LinkedIn-SDK available here https://github.com/ashwinks/PHP-LinkedIn-SDK.

I followed the developer documentation I need to authenticate first. When I run linkedin.php I am redirected to sign into my LinkedIn profile. I have to finish this step in order to touch the service above.

With the current solution my users will have to login into LinkedIn when they access my website.

How can I access a list of my company's LinkedIn posts without prompting my users to sign in?

Thanks.

解决方案

1. Generate your access token Follow the documentation https://github.com/ashwinks/PHP-LinkedIn-SDK to create a login link.

2. Save your access token Once you get it, it will be available for 60 days. Save it into your database.

3. Fetch your company posts You can use the same access token to fetch company contents

$li = new LinkedIn(...);
$li->setAccessToken(YOUR_ACCESS_TOKEN);
$posts = $li->get('/companies/YOUR_COMPANY_ID/updates/');

4. Manage response Cache or display the response after parsing it.

Hope that helps,

这篇关于领英公司供稿的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆