komalata / linkedin-j

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

Recommendations retrieval fail #91

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago

The java wrapper does not unmarshall all the data from the rest response. I try 
to get the text from the recommendations received in this way

       HashSet  fields = new HashSet<String>();
               fields.add(ProfileField.ID);
                      .....
               fields.add(ProfileField.RECOMMENDATIONS_RECEIVED);
        fields.add(ProfileField.RECOMMENDATIONS_RECEIVED_RECOMMENDER);
        fields.add(ProfileField.RECOMMENDATIONS_RECEIVED_ID);
         fields.add(ProfileField.RECOMMENDATIONS_RECEIVED_RECOMMENDATION_TYPE);

PeopleClientApi:
   LinkedInApiClientFactory factory = 
LinkedInApiClientFactory.newInstance(consumerKeyValue, consumerSecretValue);
            final PeopleApiClient client = factory.createPeopleApiClient(accessTokenValue, tokenSecretValue);

Person p = client.getProfileForCurrentUser(fields);

   for (Recommendation r : p.getRecommendationsReceived().getRecommendationList()){
              System.err.println ("RECOMMENDATION :"+r.getId());
              System.err.println ("Snippet "+r.getRecommendationSnippet());
              System.err.println ("Text "+r.getText());
              System.err.println ("Recommendation text "+r.getRecommendationText());
              System.err.println(r.getRecommender().getId());

}

The output i receive is this:

RECOMMENDATION : <number> --> OK.
Snippet null
Text null
Recommendation text null
<ID OF THE RECOMMENDER>  --> OK

If I use the apigee console, I see all the data I need.

I'm using linkedin the verion 1.415 running on a linux ubuntu x64

Original issue reported on code.google.com by rdelagu...@gmail.com on 10 Jan 2012 at 10:35

GoogleCodeExporter commented 9 years ago
Ok the API doesn't fail, but the URL parameter spec.
IF you add these fields   
fields.add(ProfileField.RECOMMENDATIONS_RECEIVED_RECOMMENDER);
        fields.add(ProfileField.RECOMMENDATIONS_RECEIVED_ID);
         fields.add(ProfileField.RECOMMENDATIONS_RECEIVED_RECOMMENDATION_TYPE);
you won't get the text

Original comment by rdelagu...@gmail.com on 10 Jan 2012 at 12:14