LinkedIn v1到v2 API迁移

A.R*_*.R. 2 android linkedin access-token linkedin-api

根据LinkedIn的公告,我们需要迁移到API和OAuth 2.0的2.0版,因此根据发布文档,我的GET请求网址从

 https://api.linkedin.com/v1/people/~:(first-name,last-name,email-address,skills,educations,positions,location,phone-numbers)?requestToken?scope=rw_nus+r_fullprofile&format=json&oauth2_access_token= 
Run Code Online (Sandbox Code Playgroud)

https://api.linkedin.com/v2/me/~:(first-name,last-name,email-address,skills,educations,positions,location,phone-numbers)?requestToken?scope=rw_nus+r_fullprofile&format=json&oauth2_access_token= 
Run Code Online (Sandbox Code Playgroud)

我得到以下回应:

{
    "serviceErrorCode": 0,
    "message": "Resource me does not exist",
    "status": 404
}
Run Code Online (Sandbox Code Playgroud)

请帮帮我,我这边出了什么问题?需要进行哪些更改?

Erv*_*emi 6

只需在URL中更改v1to v2peopleto 还有更多功能me

要请求特定字段,请传入?projection=而不是~:例如:

https://api.linkedin.com/v2/me?projection=(id,firstName,lastName)
Run Code Online (Sandbox Code Playgroud)

还请记住,v2中的字段已更改。默认情况下,除非您是LinkedIn Marketing Partners计划的一部分,否则您只能访问lite个人资料字段