mcnaggets / linkedin-j

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

Cannot fetch user->position->company id #129

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Get a user's profile:
    Set<ProfileField> fields =
            EnumSet.of(
                    ProfileField.FIRST_NAME,
                    ProfileField.LAST_NAME,
                    ProfileField.DATE_OF_BIRTH,
                    ProfileField.HEADLINE,
                    ProfileField.LOCATION,
                    ProfileField.INDUSTRY,
                    ProfileField.SUMMARY,
                    ProfileField.SPECIALTIES,
                    ProfileField.EDUCATIONS,
                    ProfileField.POSITIONS_COMPANY,
                    ProfileField.POSITIONS_COMPANY_ID,
                    ProfileField.POSITIONS_COMPANY_INDUSTRY,
                    ProfileField.POSITIONS_COMPANY_NAME,
                    ProfileField.POSITIONS_COMPANY_SIZE,
                    ProfileField.POSITIONS_COMPANY_TYPE,
                    ProfileField.POSITIONS_ID,
                    ProfileField.POSITIONS_IS_CURRENT,
                    ProfileField.POSITIONS_SUMMARY,
                    ProfileField.POSITIONS_TITLE
            );
     Person person = client.getProfileById(id, fields);
     Positions li_positions = person.getPositions();
      if (li_positions != null)
            for (Position position : li_positions.getPositionList())
                   System.out.println(position.getCompany().getId()); //Always null

This will always be null, rather than the company ID

LinkedInJ version:1.0.416
Platform: Java 7; 32b ubuntu

Original issue reported on code.google.com by richardw...@gmail.com on 28 Nov 2012 at 2:59

GoogleCodeExporter commented 9 years ago
Never mind, I fixed this. Companies do not need to have IDs, when they don't 
have a linkedin page, they will not have an ID. This is often the case for 
small firms without a linkedin presence.

Original comment by richardw...@gmail.com on 28 Nov 2012 at 4:28