How to retrieve the list of positions including all the fields using the LinkedIn javascript sdk?

空扰寡人 提交于 2019-12-05 12:53:11

Requesting URL is wrong.

Use following for positions

https://api.linkedin.com/v1/people/~:(id,positions)?format=json

Use following for locations

https://api.linkedin.com/v1/people/~:(id,location)?format=json

If you want to retrieve your profile data use this,

   IN.API.Profile("me")
        .fields([
                "firstName","lastName","headline","positions:(company,title,summary,startDate,endDate,isCurrent)","industry",
                "location:(name,country:(code))","pictureUrl","publicProfileUrl","emailAddress",
                "educations","dateOfBirth"])
        .result(onSuccess)
        .error(onError);

(or) If you want to retrieve other profile data then replace "me" with "<public profile url>"

   IN.API.Profile("url=https://nl.linkedin.com/in/williamhgates")
        .fields([
                "firstName","lastName","headline","positions:(company,title,summary,startDate,endDate,isCurrent)","industry",
                "location:(name,country:(code))","pictureUrl","publicProfileUrl","emailAddress",
                "educations","dateOfBirth"])
        .result(onSuccess)
        .error(onError);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!