【问题标题】:Unable to get Linkedin to return data from socialActions v2 endpoints无法让 Linkedin 从 socialActions v2 端点返回数据
【发布时间】:2019-05-02 22:36:52
【问题描述】:

我正在使用 Linkedin API OAuth 2.0 API,并尝试使用 Postman 客户端使用新版本 2 的 Linkedin API 对帖子或评论执行“赞”。

我已将以下权限添加到范围 r_liteprofile r_emailaddress rw_organization_admin w_organization_social r_organization_social w_member_social w_organization_social r_organization_social

并在邮递员请求中添加了相关的回调、身份验证和访问令牌 URL,以及客户端 ID 和客户端密钥 ID。

当我向\me v2 端点执行请求时,它会返回相关数据。

当我执行以下 GET 请求时,它给了我一个权限不足的错误(即使它最近已被 Linkedin 的营销 API 接受)

https://api.linkedin.com/v2/socialActions/urn%3Ali%3Aorganisation%3A24799518/comments

我希望得到数据 - 但得到一个 403 状态代码和下面的错误消息 - Not enough permissions to access: GET /socialActions/urn%3Ali%3Aorganisation%3A24799518/comments"

cURL 请求如下所示:

curl -X GET \https://api.linkedin.com/v2/socialActions/urn%3Ali%3Aorganisation%3A24799518/comments \   
-H 'Authorization: Bearer {MY BEARER TOKEN HERE}' \
-H 'Content-Type: application/json' \
-H 'Postman-Token: 59c239c2-d1c7-48ee-9e5f-a894afde95dc' \
-H 'X-Restli-Protocol-Version: 2.0.0' \
-H 'cache-control: no-cache'

--更新-- 我已经手动尝试使用 cURL 也使用 X-Restli-Protocol-Version: 2.0.0 标头并遇到同样的问题。我最终会尝试使用 API 来喜欢帖子/cmets 等。

【问题讨论】:

  • 你能展示一些你在哪里获取这个 API 的代码吗?你使用什么语言?
  • 您是否在添加新权限后重新请求了访问令牌?

标签: oauth-2.0 linkedin linkedin-api


【解决方案1】:

Social Action Api 不适用于组织|页面

GET https://api.linkedin.com/v2/socialActions/{shareUrn|ugcPostUrn|commentUrn}/comments

适用于分享|ugcPost|评论

使用以下请求获取共享并使用上述请求中的共享 ID 获取帖子的 cmets

GET https://api.linkedin.com/v2/shares?owners=urn:li:organization:24799518&q=owners&count=100

【讨论】:

    猜你喜欢
    • 2018-06-28
    • 2018-10-19
    • 2019-09-13
    • 1970-01-01
    • 2017-09-20
    • 2019-06-05
    • 2018-07-23
    • 2022-06-19
    • 2019-07-13
    相关资源
    最近更新 更多