0

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

<dependency>
<groupId>com.googlecode.linkedin-j</groupId>
<artifactId>linkedin-j-core</artifactId>
<version>1.0.429</version>
</dependency>

但这不再起作用了。我的图书馆正在使用已弃用的 API:

/v1/people/~/current-status

并且无论何时运行它都会引发如下异常:

Exception in thread "main" com.google.code.linkedinapi.client.LinkedInApiClientException: Unsupported PUT target {/v1/people/~/current-status}

因此,我在 LinkedIn 文档中查找新更新,但找不到用于发布用户当前个人资料状态的适当文档...

https://developer.linkedin.com/documents/profile-api

当前停止工作的代码与使用 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");

如何通过其 api 在 LinkedIn 上发布状态更新?

4

2 回答 2

0

阅读你自己的问题。

我的图书馆正在使用已弃用的 API:

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

不支持的 PUT 目标 {/v1/people/~/current-status}

这意味着您正在使用的不推荐使用的库具有一个功能updateCurrentStatus,但在 API 端点下,请求被发送到不支持 PUT 动词。

于 2016-02-26T14:31:49.147 回答
0

要消除该错误,您需要linked-j在构建路径中添加 jar。这是下载jar的链接http://www.java2s.com/Code/Jar/l/Downloadlinkedinjjar.htm

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

于 2016-06-28T06:05:42.187 回答