LinkedIn v1 到 v2 API 迁移
LinkedIn v1 to v2 API migration
根据 LinkedIn 公告,我们需要迁移到 2.0 版 API 和 OAuth 2.0,因此根据发布文档,我已将我的 GET
请求 url 更改为
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=
到
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=
我收到以下回复:
{
"serviceErrorCode": 0,
"message": "Resource me does not exist",
"status": 404
}
请帮帮我,我这边有什么问题吗?需要做哪些改变?
只需将 URL 中的 v1
更改为 v2
并将 people
更改为 me
即可。
要请求 specific fields,您传入 ?projection=
而不是 ~:
例如:
https://api.linkedin.com/v2/me?projection=(id,firstName,lastName)
另请注意,v2 中的字段已更改。默认情况下,您只能访问 lite profile fields, unless you're part of LinkedIn Marketing Partners 程序。
根据 LinkedIn 公告,我们需要迁移到 2.0 版 API 和 OAuth 2.0,因此根据发布文档,我已将我的 GET
请求 url 更改为
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=
到
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=
我收到以下回复:
{
"serviceErrorCode": 0,
"message": "Resource me does not exist",
"status": 404
}
请帮帮我,我这边有什么问题吗?需要做哪些改变?
只需将 URL 中的 v1
更改为 v2
并将 people
更改为 me
即可。
要请求 specific fields,您传入 ?projection=
而不是 ~:
例如:
https://api.linkedin.com/v2/me?projection=(id,firstName,lastName)
另请注意,v2 中的字段已更改。默认情况下,您只能访问 lite profile fields, unless you're part of LinkedIn Marketing Partners 程序。