0

I am using Spring Social to connect to LinkedIn and Facebook. I downloaded the source code from this link:

Github Spring Social LinkedIn Examples

In this project, I am running “Spring.MvcQuickStart” under examples directory. It works pretty well but I don't know how to get the user’s email. I need to know how can I get the user’s email in the controller given at this link. I've added scope parameters like this:

parameters.Add("scope", "r_emailaddress r_fullprofile");

I can get the full profile of the user like this:

LinkedInFullProfile profile = linkedInClient.ProfileOperations.GetUserFullProfil eAsync().Result;

But the full profile does not contain user email (the email the user provided in his LinkedIn profile). I've no idea how to get the user's email.

mmmmmm
  • 32,227
  • 27
  • 88
  • 117
Mudasser Hassan
  • 716
  • 2
  • 9
  • 27

1 Answers1

0

The actual implemtation does not read email attribute, but you can get it using classic REST operations:

JsonValue jsonResult = linkedIn.RestOperations.GetForObjectAsync<JsonValue>("people/{~}:(email-address)?format=json").Result;
bbaia
  • 1,193
  • 7
  • 8
  • Thanks. What about getting Twitter followers? I tried to do like this `System.Threading.Tasks.Task> followers = twitterClient.FriendOperations.GetFollowersAsync();` but it returns nothing. I think Twitter API is different and there is nothing like scope parameters if I am not wrong. Please correct me if I've to add some scope parameter to get the followers list (ids and names) – Mudasser Hassan Jan 28 '13 at 13:17
  • Also, please help me how can I send direct message to any follower on Twitter? – Mudasser Hassan Jan 28 '13 at 13:18
  • 1 more thing. How to send HTML in LinkedIn Message? Supported by Spring Social API or not? – Mudasser Hassan Jan 28 '13 at 13:26
  • I've check the documentation on Spring Social website as well for FriendOperations at this [link](http://static.springsource.org/spring-social-twitter/docs/1.0.x/reference/html/apis.html) but the methods mentioned in documentation are not available to me in the API example uploaded by you on Github – Mudasser Hassan Jan 28 '13 at 14:06
  • There is actually 2 versions of the Twitter REST API: v1.0 (dev.twitter.com/docs/api/1) and v1.1 (dev.twitter.com/docs/api/1.1). – bbaia Jan 29 '13 at 07:23
  • Spring.Social.Twitter 1.0.x works on REST API v1 and Spring.Social.Twitter 2.0 M1 works on REST API v1.1 – bbaia Jan 29 '13 at 07:25