[英]how to connect linkedin from node js. Or how to get access token from node js
这是我的代码。 现在,IN.API.Profile(“ me”)函数不起作用。 他们返回404错误,并显示类似“ v1已过时”的消息。 这样任何人都可以帮助我。 提前致谢。!!
IN.User.authorize(() => {
if (IN.User.isAuthorized()) {
IN.API.Profile("me").fields([
"id", "first-name", "last-name", "headline", "positions", "location",
"num-connections", "emailAddress", "publicProfileUrl", "picture-urls::(original)",
"publications", "languages", "skills", "certifications", "educations", "volunteer",
"recommendations-received","date-of-birth",
]).result((data) => {
console.warn(data);
});
}
});
消息中有什么令人费解: v1 was deprecated
?
最终支持此api版本。 更新库https://www.npmjs.com/package/node-linkedin-v2
//编辑,示例代码
let in = new LinkedInRestClient(...)
let access_token = await in.getAccessToken(...)
in.getCurrentMemberProfile(fields, access_token).then()
或针对用户配置文件:使用指令和方法getAuthorizationUrl
生成url,然后实现redirect_url
路由以存储用户access_token
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.