分享到领英
帮助人们在领英上分享您的内容,扩大内容的覆盖面
希望怎样分享到领英?
开始之前……
请务必阅读 REST API 入门指南,了解如何在应用中成功分享领英内容的重要信息。
通过 REST API 分享内容有两种方法。无论您选择哪种方式,API 端点均相同,仅请求正文的格式不同。
请求正文
字段名称 |
| 字段描述 | 字数上限 (字符数) |
content |
| 一系列描述分享内容的字段。 |
|
title | 分享内容的标题。 | 200 | |
description | 分享内容的说明。 | 256 | |
submitted-url | 分享内容的完全限定网址。 | 无 | |
submitted-image-url | 分享内容缩略图的完全限定网址。 | 无 | |
comment |
| 会员针对分享内容所做的评论。 如果未提供以上内容参数,则评论必须包含分享内容的网址。 如果评论中包含多个网址,则只分析分享内容的第一个网址。 | 700 |
visibility |
| 一些有关分享内容的公开性信息。 |
|
code | 以下其中一个值:
此字段是所有分享调用中的必填字段。 | 无 |
{
"comment": "Check out developer.linkedin.com! http://linkd.in/1FC2PyG",
"visibility": {
"code": "anyone"
}
}
<share>
<comment>Check out developer.linkedin.com! http://linkd.in/1FC2PyG</comment>
<visibility>
<code>anyone</code>
</visibility>
</share>
{
"comment": "Check out developer.linkedin.com!",
"content": {
"title": "LinkedIn Developers Resources",
"description": "Leverage LinkedIn's APIs to maximize engagement",
"submitted-url": "https://developer.linkedin.com",
"submitted-image-url": "https://example.com/logo.png"
},
"visibility": {
"code": "anyone"
}
}
<share>
<comment>Check out developer.linkedin.com!</comment>
<content>
<title>LinkedIn Developer Resources</title>
<description>Leverage LinkedIn's APIs to maximize engagement</description>
<submitted-url>https://developer.linkedin.com</submitted-url>
<submitted-image-url>https://example.com/logo.png</submitted-image-url>
</content>
<visibility>
<code>anyone</code>
</visibility>
</share>
{
"updateKey": "UPDATE-3346389-595113200…",
"updateUrl": "https://www.linkedin.com/updates?discuss=…&scope=…"
}
权限和限制
使用 Open Graph 改善内容分享
如果您是内容作者,且希望改善本人或其他任何人分享您的领英内容的效果,您可在 HTML 页面的 <head> 中包含 Open Graph 标准的 <meta> 标签,由此控制领英 (以及其他大部分主要内容分享平台) 可以在分享内容中展示的信息。
如果存在 Open Graph 标签,领英的抓取工具将无需依赖自身的分析确定要分享哪些内容,从而提高所分享信息与您希望分享信息吻合的机率。
<html prefix="og: http://ogp.me/ns#">
<head>
<meta property="og:title" content="My Shared Article Title" />
<meta property="og:description" content="Description of shared article" />
<meta property="og:url" content="http://example.com/my_article.html" />
<meta property="og:image" content="http://example.com/foo.jpg" />
</head>
<body>
…
</body>
</html>