You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

权限不足:如何通过LinkedIn API获取登录用户的更多资料字段?

LinkedIn API /v2/me 权限拒绝及字段无法获取问题解决

核心问题分析

  • 权限不匹配:你当前的r_basicprofile(已被v2 API弃用,由r_liteprofile替代)、w_member_social、r_organization_social权限均无法访问location、certificate、education这类用户扩展资料字段:
    • r_liteprofile仅支持获取id、firstName、lastName、profilePicture等基础字段;
    • w_member_social和r_organization_social是用于内容发布、组织社交数据的权限,与用户个人资料无关联。
  • 字段名错误:你请求中使用的course、certificate不是LinkedIn v2 API的合法字段名,正确字段应为educations(教育经历)、certifications(证书)。字段名错误会导致API忽略请求参数,仅返回默认投影字段。

解决方案

  1. 申请对应权限:访问location、educations、certifications字段需申请r_member_profile权限。该权限需在LinkedIn开发者控制台提交审核,你需要详细说明字段的使用场景(如用户资料完善、个性化服务等),审核通过后方可启用。
  2. 修正接口请求参数:权限通过后,使用正确字段名调用接口,示例如下:
    • 使用fields参数:
      GET https://api.linkedin.com/v2/me?fields=id,firstName,profilePicture,educations,certifications,location
      
    • 使用投影参数:
      GET https://api.linkedin.com/v2/me?projection=(id,firstName,profilePicture,educations,certifications,location)
      

内容的提问来源于stack exchange,提问作者Aditya N

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.01 02:45:10