参数中的字段值验证失败:在 linkedIn API V2 中处理字段 [/authors] 时出现数据处理异常

Field Value validation failed in PARAMETER: Data Processing Exception while processing fields [/authors] in linkedIn API V2

有个

我尝试了答案中给出的解决方案。

我尝试了多种方案,但我不断收到以下错误:

URL1:

var companyid = '123456789';
var url = "https://api.linkedin.com/v2/ugcPosts?q=authors&authors=List("+ encodeURIComponent(companyid)+")";

下面 url returns 的日志 url:

https://api.linkedin.com/v2/ugcPosts?q=authors&authors=List(urn%3Ali%3Aorganization%3A123456789)

网址 2:

var companyid = '123456789';
var url = "https://api.linkedin.com/v2/ugcPosts?q=authors&authors=List("+(companyid)+")";

下面 url returns 的日志 url:

https://api.linkedin.com/v2/ugcPosts?q=authors&authors=List(urn:li:organization:123456789)

以下是我请求的身份验证权限:

r_liteprofile
r_emailaddress
w_member_social
rw_organization_admin
rw_organization
r_organization_social

您应该添加有关 V2 协议版本广告的 header 信息 in the doc:

All API requests are represented in protocol 2.0.0 and require the header X-Restli-Protocol-Version: 2.0.0.

因此,如果您进行了 API 呼叫:

curl  -H "X-Restli-Protocol-Version:2.0.0" "https://api.linkedin.com/v2/ugcPosts?q=authors&authors=List(urn%3Ali%3Aorganization%3A123456789)&oauth2_access_token=<access_token>"

您将检索一些数据,例如:

{"elements":[],"paging":{"total":0,"count":10,"start":0,"links":[]}

希望对您有所帮助