简体   繁体   中英

how to connect linkedin from node js. Or how to get access token from node js

Here is my code. Now IN.API.Profile("me") function not working. They return 404 error with message like "v1 was deprecated". So anyone can help me. Thanks in advance.!!

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);
        }); 
    }
});

What is incomprehensible is in the message: v1 was deprecated ?

In end support for this api version. Update the library https://www.npmjs.com/package/node-linkedin-v2

//edit, sample code

let in = new LinkedInRestClient(...)
let access_token = await in.getAccessToken(...)
in.getCurrentMemberProfile(fields, access_token).then()

Or for user profile: use instruction and method getAuthorizationUrl to generate url, and then implement redirect_url route to store user access_token

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM