如何通过LinkedIn的api发布状态更新?

如何通过LinkedIn的api发布状态更新?,linkedin,linkedin-j,Linkedin,Linkedin J,现在,我正在使用一个java库: <dependency> <groupId>com.googlecode.linkedin-j</groupId> <artifactId>linkedin-j-core</artifactId> <version>1.0.429</version> </dependency> 无论何时运行,它都会抛出如下异常: Exception in thread "main"

现在,我正在使用一个java库:

<dependency>
<groupId>com.googlecode.linkedin-j</groupId>
<artifactId>linkedin-j-core</artifactId>
<version>1.0.429</version>
</dependency>
无论何时运行,它都会抛出如下异常:

Exception in thread "main" com.google.code.linkedinapi.client.LinkedInApiClientException: Unsupported PUT target {/v1/people/~/current-status}
所以我在LinkedIn文档中查找新的更新,但找不到发布用户当前配置文件状态的合适文档

停止工作的当前代码与使用LinkedInJ时的代码类似:

LinkedInApiClientFactory factory = LinkedInApiClientFactory.newInstance(getApiKey(), getSecretApiKey());
LinkedInAccessToken accessToken = new LinkedInAccessToken(promotion.getAccessToken(), promotion.getSecretAccessToken());
LinkedInApiClient client = factory.createLinkedInApiClient(accessToken);
client.updateCurrentStatus("my status message");

如何通过LinkedIn的api发布状态更新?

阅读您自己的问题

I库正在使用不推荐使用的API:

已弃用表示不再支持它,这与您收到的错误消息同时出现:

不支持的放置目标{/v1/people/~/current status}


这意味着您正在使用的不推荐使用的lib有一个函数
updateCurrentStatus
,但在该函数的覆盖下,请求所针对的API端点不支持PUT动词。

要消除该错误,您需要在构建路径中添加
linked-j
jar。下面是下载jar的链接


我的问题在添加jar后得到了解决。

这个问题似乎离题了,因为它是一个客户支持请求,而不是关于编程问题的问题。有关更多信息,请参阅。事实上,我已经为此收回了我的简历,因此上述评论无效(IMO)。
LinkedInApiClientFactory factory = LinkedInApiClientFactory.newInstance(getApiKey(), getSecretApiKey());
LinkedInAccessToken accessToken = new LinkedInAccessToken(promotion.getAccessToken(), promotion.getSecretAccessToken());
LinkedInApiClient client = factory.createLinkedInApiClient(accessToken);
client.updateCurrentStatus("my status message");