LinkedIn-J does not return educations

半腔热情 提交于 2019-12-25 08:59:22

问题


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?


回答1:


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;


来源:https://stackoverflow.com/questions/9916711/linkedin-j-does-not-return-educations

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!