现在,我正在使用一个库 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 上发布状态更新?