返回顶部
l

linkedin领英

|

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.6
安全检测
已通过
9,754
下载量
免费
免费
43
收藏
概述
安装方式
版本历史

linkedin

LinkedIn

通过托管 OAuth 认证访问 LinkedIn API。发布帖子、管理广告活动、获取个人资料和组织信息、上传媒体文件以及访问广告库。

快速开始

bash

获取当前用户个人资料


python < import urllib.request, os, json
req = urllib.request.Request(https://gateway.maton.ai/linkedin/rest/me)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
req.add_header(LinkedIn-Version, 202506)
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

基础 URL

https://gateway.maton.ai/linkedin/rest/{resource}

网关将请求代理至 api.linkedin.com,并自动注入您的 OAuth 令牌。

认证

所有请求都需要在 Authorization 标头中携带 Maton API 密钥:

Authorization: Bearer $MATONAPIKEY

环境变量: 将您的 API 密钥设置为 MATONAPIKEY:

bash
export MATONAPIKEY=YOURAPIKEY

获取您的 API 密钥

  1. 1. 在 maton.ai 登录或创建账户
  2. 前往 maton.ai/settings
  3. 复制您的 API 密钥

必需标头

LinkedIn REST API 需要版本标头:

LinkedIn-Version: 202506

连接管理

在 https://ctrl.maton.ai 管理您的 LinkedIn OAuth 连接。

列出连接

bash
python < import urllib.request, os, json
req = urllib.request.Request(https://ctrl.maton.ai/connections?app=linkedin&status=ACTIVE)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

创建连接

bash
python < import urllib.request, os, json
data = json.dumps({app: linkedin}).encode()
req = urllib.request.Request(https://ctrl.maton.ai/connections, data=data, method=POST)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
req.add_header(Content-Type, application/json)
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

获取连接

bash
python < import urllib.request, os, json
req = urllib.request.Request(https://ctrl.maton.ai/connections/{connection_id})
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

响应:
json
{
connection: {
connection_id: ba10eb9e-b590-4e95-8c2e-3901ff94642a,
status: ACTIVE,
creation_time: 2026-02-07T08:00:24.372659Z,
lastupdatedtime: 2026-02-07T08:05:16.609085Z,
url: https://connect.maton.ai/?session_token=...,
app: linkedin,
metadata: {}
}
}

在浏览器中打开返回的 url 以完成 OAuth 授权。

删除连接

bash
python < import urllib.request, os, json
req = urllib.request.Request(https://ctrl.maton.ai/connections/{connection_id}, method=DELETE)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

指定连接

如果您有多个 LinkedIn 连接,请使用 Maton-Connection 标头指定要使用的连接:

bash
python < import urllib.request, os, json
req = urllib.request.Request(https://gateway.maton.ai/linkedin/rest/me)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
req.add_header(LinkedIn-Version, 202506)
req.add_header(Maton-Connection, ba10eb9e-b590-4e95-8c2e-3901ff94642a)
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

如果省略,网关将使用默认(最早)的活动连接。

API 参考

个人资料

获取当前用户个人资料

bash
GET /linkedin/rest/me
LinkedIn-Version: 202506

示例:
bash
python < import urllib.request, os, json
req = urllib.request.Request(https://gateway.maton.ai/linkedin/rest/me)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
req.add_header(LinkedIn-Version, 202506)
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

响应:
json
{
firstName: {
localized: {en_US: John},
preferredLocale: {country: US, language: en}
},
localizedFirstName: John,
lastName: {
localized: {en_US: Doe},
preferredLocale: {country: US, language: en}
},
localizedLastName: Doe,
id: yrZCpj2Z12,
vanityName: johndoe,
localizedHeadline: Software Engineer at Example Corp,
profilePicture: {
displayImage: urn:li:digitalmediaAsset:C4D00AAAAbBCDEFGhiJ
}
}

发布帖子

创建文本帖子

bash
POST /linkedin/rest/posts
Content-Type: application/json
LinkedIn-Version: 202506

{
author: urn:li:person:{personId},
lifecycleState: PUBLISHED,
visibility: PUBLIC,
commentary: Hello LinkedIn! This is my first API post.,
distribution: {
feedDistribution: MAIN_FEED
}
}

响应: 201 Created,包含包含帖子 URN 的 x-restli-id 标头。

创建文章/URL 分享

bash
POST /linkedin/rest/posts
Content-Type: application/json
LinkedIn-Version: 202506

{
author: urn:li:person:{personId},
lifecycleState: PUBLISHED,
visibility: PUBLIC,
commentary: Check out this great article!,
distribution: {
feedDistribution: MAIN_FEED
},
content: {
article: {
source: https://example.com/article,
title: Article Title,
description: Article description here
}
}
}

创建图片帖子

首先,初始化图片上传,然后上传图片,最后创建帖子。

步骤 1:初始化图片上传
bash
POST /linkedin/rest/images?action=initializeUpload
Content-Type: application/json
LinkedIn-Version: 202506

{
initializeUploadRequest: {
owner: urn:li:person:{personId}
}
}

响应:
json
{
value: {
uploadUrlExpiresAt: 1770541529250,
uploadUrl: https://www.linkedin.com/dms-uploads/...,
image: urn:li:image:D4D10AQH4GJAjaFCkHQ
}
}

步骤 2:上传图片二进制数据
bash
PUT {uploadUrl from step 1}
Content-Type: image/png

{binary image data}

步骤 3:创建图片帖子
bash
POST /linkedin/rest/posts
Content-Type: application/json
LinkedIn-Version: 202506

{
author: urn:li:person:{personId},
lifecycleState: PUBLISHED,
visibility: PUBLIC,
commentary: Check out this image!,
distribution: {
feedDistribution: MAIN_FEED
},
content: {
media: {
id: urn:li:image:D4D10AQH4GJAjaFCkHQ,
title: Image Title
}
}
}

可见性选项

| 值 | 描述 |

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 linkedin-api-1776373581 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 linkedin-api-1776373581 技能

通过命令行安装

skillhub install linkedin-api-1776373581

下载

⬇ 下载 linkedin v1.0.6(免费)

文件大小: 9.37 KB | 发布时间: 2026-4-17 15:14

v1.0.6 最新 2026-4-17 15:14
- No changes detected in this release.
- Version number incremented to 1.0.6.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部