LinkedIn-J不返回教育 [英] LinkedIn-J does not return educations

查看:92
本文介绍了LinkedIn-J不返回教育的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用LinkedIn-J.我的应用程序进行身份验证没有问题,我从用户那里获取了数据-甚至是他们的名字,姓氏等.

Person profile = client.getProfileForCurrentUser();
profile.getFirstName();

但是,当我尝试获取教育列表时,返回的Educations对象是null:

Educations educations = profile.getEducations();
educations == null

可能是什么错误?我的应用程序是否应该要求授予特殊权限?

解决方案

我以前从未使用过Linkedin-j api,但是根据LinkedIn api,默认情况下,您会得到名字,姓氏,标题和一些URL. /p>

因此,我相信您需要指定您要退学.我不知道如何在LinkedIn-J中做到这一点.

http://developer.linkedin.com/documents/profile-api

例如,对于其余的api,您将使用此uri:

http://api.linkedin.com/v1/people/id=12345:(first-name,last-name, educations)

使用LinkedIn J库,似乎您必须使用Set作为参数将配置文件字段添加到客户端中许多方法之一.

您可以调用许多方法的示例(如果您有连接的用户):

public Person getProfileForCurrentUser(Set<ProfileField> profileFields)

ProfileField是位于此处的枚举:

import com.google.code.linkedinapi.client.enumeration.ProfileField;

I am using LinkedIn-J. My application authenticates without problem, I get data from the user - even their first name, last name etc.

Person profile = client.getProfileForCurrentUser();
profile.getFirstName();

However, when I try to get the list of educations, the Educations object returned is null:

Educations educations = profile.getEducations();
educations == null

What can be the error? Should my application ask for special permissions to be granted?

解决方案

I've never used the Linkedin-j api before, but according to the LinkedIn api you get firstname, lastname, headline, and some url by default.

So I believe you need to specify that you want education returned. I don't know how to do that in LinkedIn-J though.

http://developer.linkedin.com/documents/profile-api

For example, with the rest api you'd use this uri:

http://api.linkedin.com/v1/people/id=12345:(first-name,last-name, educations)

Using the LinkedIn J library, it seems like you have to add profile fields using Set as a parameter to one of their many methods in the client.

Example of a method you could call of many (if you have a connected user):

public Person getProfileForCurrentUser(Set<ProfileField> profileFields)

ProfileField is an Enum located here:

import com.google.code.linkedinapi.client.enumeration.ProfileField;

这篇关于LinkedIn-J不返回教育的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆