I'm trying to get the summary and Skills fields from the LinkedIn API using Sparkle.LinkedIn. Everything works fine, I can read Headline, FirstName and LastName fields, but Skills, Summary, Industry, DateOfBirth and other fields are always empty even if the LinkedIn profile has them for sure.
Here is the code I'm using when the user has already been authenticated and I have the token:
var fields = FieldSelector.For<Person>()
.WithId()
.WithFirstName()
.WithLastName()
.WithEmailAddress()
.WithHeadline()
.WithPictureUrl()
.WithPublicProfileUrl()
.WithSummary()
.WithIndustry()
.WithDateOfBirth()
.WithSkills();
var config = new LinkedInApiConfiguration("api-key", "key-secret");
var api = new LinkedInApi(config);
if(!string.IsNullOrEmpty(error) || !string.IsNullOrEmpty(error_description))
{
Response.Write(error + "<br/>" + error_description);
}
else
{
var redirectUrl = "my-redirect-url";
var userToken = api.OAuth2.GetAccessToken(code, redirectUrl);
var acceptLanguages = new string[] { "it-IT","en-US", };
var user = new UserAuthorization(userToken.AccessToken);
Person profile = api.Profiles.GetMyProfile(user,acceptLanguages,fields);
Response.Write(profile.Headline + "<br/>");
Response.Write(profile.Summary + "<br/>"); //always empty
Response.Write(profile.Industry + "<br/>"); //always empty
Response.Write(profile.PictureUrl + "<br/>"); //always empty
if(profile.Skills!=null) //always null
{
foreach (var sk in profile.Skills.Skill)
{
Response.Write(sk.SkillName.Name + "<br/>");
}
}
Response.Write(profile.Lastname + "<br/>");
Response.Write(profile.DateOfBirth.Year + "<br/>"); //always empty
}
How can I retrieve also the summary and skills fields?