akhil2909 / linkedin-j

Automatically exported from code.google.com/p/linkedin-j
0 stars 0 forks source link

Cannot get profile picture of current user #70

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Making a call to get the current user, for which I have used the tokens to get 
to, returns a Person object with only first/last name, company name, and 
headline:

LinkedInApiClientFactory factory = 
LinkedInApiClientFactory.newInstance(Common.LINKEDIN_CONSUMER_KEY, 
Common.LINKEDIN_CONSUMER_SECRET);

LinkedInAccessToken accessToken = new LinkedInAccessToken(token, secretToken);
LinkedInApiClient client = factory.createLinkedInApiClient(accessToken);

Person p = client.getProfileForCurrentUser();

I would expect for "p.getPictureUrl()" to return the profile URL but it's null.

Original issue reported on code.google.com by cstewart...@gmail.com on 16 Sep 2011 at 5:38

GoogleCodeExporter commented 9 years ago
You will have to use field selectors. e.g.
Person profile = 
client.getProfileForCurrentUser(EnumSet.of(ProfileField.FIRST_NAME, 
ProfileField.LAST_NAME, ProfileField.PICTURE_URL));

Original comment by nabeelmukhtar on 20 Sep 2011 at 12:02