akhil2909 / linkedin-j

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

PersonList object doesn't return all the connections. #94

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
We have a linkedin profile with 680 connections. We want display all the user 
connections,so we are getting connections for that user and iterating through 
the PersonList object.
Here is the sample code:

LinkedInApiClientFactory factory = LinkedInApiClientFactory.newInstance(apiKey, 
apiSecret);
LinkedInApiClient client = factory.createLinkedInApiClient(accessToken);

Connections cons = 
client.getConnectionsForCurrentUser(EnumSet.of(ProfileField.FIRST_NAME,
ProfileField.LAST_NAME,ProfileField.DATE_OF_BIRTH, 
ProfileField.SITE_STANDARD_PROFILE_REQUEST_URL,
ProfileField.POSITIONS_IS_CURRENT,ProfileField.LOCATION_NAME, 
ProfileField.POSITIONS_COMPANY,
ProfileField.POSITIONS_COMPANY_NAME,ProfileField.PICTURE_URL,ProfileField.CONNEC
TIONS,
ProfileField.ID,ProfileField.NUM_CONNECTIONS, ProfileField.POSITIONS_TITLE));

List<Person> personList = cons.getPersonList();

When we do: cons.getTotal(); we are getting 680 (which is correct)
But when we do: personList.size(); we are getting 670

Initially we thought this might be because some of the connections have set the 
privacy setting( to share info with 3rd party apps as false).
But that doesn't seem to be the case. The PersonList object is returning those 
connections also (with blank id and name)
Why this discrepancy?Are we missing anything in our code?

Original issue reported on code.google.com by kalyan.c...@gmail.com on 6 Feb 2012 at 6:21

GoogleCodeExporter commented 9 years ago
how did you set scope parameter with linkedin-j ?

Original comment by deepakch...@gmail.com on 2 Oct 2012 at 4:33