【问题标题】:How to retrieve the list of positions including all the fields using the LinkedIn javascript sdk?如何使用 LinkedIn javascript sdk 检索包括所有字段的职位列表?
【发布时间】:2016-02-08 20:24:16
【问题描述】:

我想获取领英会员在其个人资料中输入的每个职位的 ID、职位、摘要、开始日期、结束日期、当前职位和公司名称。

我在REST Console 上测试了一个查询,得到了想要的结果。查询是“https://api.linkedin.com/v1/people/~/positions:(id,title,summary,start-date,end-date,is-current,company)?format=json”。

问题是,当我尝试使用 LinkedIn javascript SDK 做同样的事情时,我没有得到每个职位的完整字段列表。我正在获取完整的职位列表,但不是每个职位的所有字段。

这是我使用 javascript SDK 进行的调用:

//in this function I'm specifying the list of fields that I want to retrieve for each position
//but I'm getting only some fields (id, start-date and end-date)
function getProfileData() {
        IN.API.Raw("/people/~/positions:(id,title,summary,start-date,end-date,is-current,company)?format=json").result(onSuccess).error(onError);
}

有人知道我需要做什么才能获得与使用 REST 控制台相同的结果吗?

【问题讨论】:

    标签: javascript linkedin linkedin-jsapi


    【解决方案1】:

    【讨论】:

    • 答案不起作用。我试过我得到了这个结果返回:{“id”:“wQplQQjzLa”,“positions”:{“_total”:0}}因为我的代码是:function getProfileData(){IN.API.Raw(“/people/~ :(id,positions)?format=json").result(onSuccess).error(onError); }
    • 查看那里的文档,它对我有用。 developer.linkedin.com/docs/fields/basic-profile
    【解决方案2】:

    如果您想检索您的个人资料数据,请使用此功能,

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

    (或)如果您想检索其他配置文件数据,请将“me”替换为“<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);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-07-31
      • 1970-01-01
      • 1970-01-01
      • 2013-01-16
      • 2012-05-10
      • 1970-01-01
      • 2012-01-23
      • 2019-02-06
      相关资源
      最近更新 更多