bharadwaj moksha
bharadwaj moksha

Reputation: 1

Unable to get r_emailaddress from https://api.linkedin.com/v2/me

I have used,

<OAuthConfig  oAuthScope="r_liteprofile r_emailaddress" providerId="LINKED_IN" userProfileUrl="https://api.linkedin.com/v2/me"/>

and using OAuth2 for this but I'm unable retrieve email with this. Is there possibility to get both email & liteprofile from single accesstoken request?

My app is having permissions with

r_liteprofile
r_emailaddress
w_member_social

Can anyone help me with this? Thanks in advance.

THIS IS THE RESPONSE I'm getting,

THIS IS JSON OBJECT:

{"lastName":{"localized":{"en_US":"global"},"preferredLocale":{"country":"US","language":"en"}},"firstName":{"localized":{"en_US":"Gifting"},"preferredLocale":{"country":"US","language":"en"}},"id":"_Ru_P5gptv"}

net.sf.json.JSONException: JSONObject["emailAddress"] not found.

Upvotes: 0

Views: 736

Answers (1)

Christopher Ou
Christopher Ou

Reputation: 584

The email address is available via the /emailAddress API, not the /me API.

You will need to make an additional GET request to https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~))

Upvotes: 2

Related Questions