LinkedIn API获取教育数据失败及工作经历获取方法咨询
问题解决:LinkedIn API 教育数据未返回 & 工作经历获取指引
一、教育数据未返回的原因及修复步骤
- 权限范围(Scope)错误
r_basicprofile已被LinkedIn API废弃,无法获取教育类扩展数据。你需要替换为以下权限:
r_liteprofile:获取基础用户信息r_member_profile:获取完整的个人资料数据(包括教育经历)
重新发起OAuth授权时,务必请求这两个scope,而非旧的r_basicprofile。
- Projection参数冗余
你的请求中同时包含了已废弃的education字段和正确的educations字段,建议移除education以避免解析问题。优化后的projection参数为:
(id,educations*(id,degreeName,fieldOfStudyName,grade,organization,schoolName,activities,notes,startMonthYear,endMonthYear),vanityName,profilePicture(displayImage~:playableStreams))
- 验证个人资料数据
确认目标LinkedIn账号的个人资料中已填写教育经历,空数据不会在响应中返回。
优化后的curl请求示例:
curl --location 'https://api.linkedin.com/v2/me?projection=(id%2Ceducations*(id%2CdegreeName%2CfieldOfStudyName%2Cgrade%2Corganization%2CschoolName%2Cactivities%2Cnotes%2CstartMonthYear%2CendMonthYear)%2CvanityName%2CprofilePicture(displayImage~%3AplayableStreams))' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN'
二、工作经历数据获取指引
在LinkedIn v2 API中,工作经历通过/me接口的experiences字段获取,需配合r_member_profile权限。
示例projection参数(包含工作经历核心字段):
(id,experiences*(id,companyName,title,startMonthYear,endMonthYear,description,locationName),vanityName)
对应的curl请求示例:
curl --location 'https://api.linkedin.com/v2/me?projection=(id%2Cexperiences*(id%2CcompanyName%2Ctitle%2CstartMonthYear%2CendMonthYear%2Cdescription%2ClocationName)%2CvanityName)' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN'
注意:所有请求必须使用包含对应scope的有效访问令牌,否则会返回权限不足错误。
内容的提问来源于stack exchange,提问作者Nik
相关产品推荐
相关产品推荐

