通过LinkedIn V2 API检索UGC帖子时收到ClassCastException错误 [英] Retrieve UGC Posts through LinkedIn V2 API got ClassCastException error

查看:86
本文介绍了通过LinkedIn V2 API检索UGC帖子时收到ClassCastException错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过调用以下API来检索UGC帖子列表

I'm trying to retrieve a list of UGC posts by calling the following API

https://api.linkedin.com/v2/ugcPosts?q=authors&authors=List%28urn%3Ali%3Aorganization%3A[ORG_ID]%29

[ORG_ID] 是我的组织的ID.然后我得到了这个错误

[ORG_ID] is id of my organization. Then I got this error

{
    "serviceErrorCode": 0,
    "message": "java.lang.ClassCastException: java.lang.String cannot be cast to com.linkedin.data.DataComplex",
    "status": 500
}

我已经被授权使用API​​ V2,并且在标头中包含X-Restli-Protocol-Version:2.0.0.

I've already authorized to use API V2 and include X-Restli-Protocol-Version:2.0.0 in the header.

推荐答案

我也遇到了这个问题,不应对authors查询参数上的括号进行编码.

I was having issues with this too, the parens on the authors query param shouldn't be encoded.

即,尝试: https://api.linkedin.com/v2/ugcPosts?q=authors&authors=List(urn%3Ali%3Aorganization%3A[ORG_ID])

这篇关于通过LinkedIn V2 API检索UGC帖子时收到ClassCastException错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆