Question: I see other discussion like these, hovewer i can't figure out how to get the email address from linkedin API, i enabled r\_emailaddress in my app, here what i have done:

index.html:

```
    <!-- Linkedin login -->
 <script type="text/javascript" src="http://platform.linkedin.com/in.js">
    api_key: myapikey
    scope: r_basicprofile r_emailaddress
    onLoad:onLinkedInLoad
    authorize:true
    lang:en_US
 </script>  
 <script type="in/Login"></script>

```

and here the script:

```
    // Setup an event listener to make an API call once auth is complete
function onLinkedInLoad() {
    IN.Event.on(IN, "auth", getProfileData);
}

// Handle the successful return from the API call
function onSuccess(data) {
    console.log(data);
    $('#nome').val(data.firstName);
    $('#cognome').val(data.lastName);
    $('#email').val(data.emailAddress);             
}

// Handle an error response from the API call
function onError(error) {
    console.log(error);
}

// Use the API call wrapper to request the member's basic profile data
function getProfileData() {
    var fields = ['firstName', 'lastName', 'emailAddress'];
    IN.API.Raw("/people/~").result(onSuccess).error(onError);   
}

```

i want to populate an input field with data.emailAdress, but i don't have it in the object, someone know what to do? thank you!

Answer: 
I got it at least!

```
IN.API.Raw("/people/~:(id,firstName,lastName,emailAddress)?format=json")
    .result(onSuccess)
    .error(onError);

```
Aya Magdy provided an answer to this question on the following SO Question page:

[How do I get email address field using the LinkedIn Javascript API?](https://stackoverflow.com/questions/19843698/how-do-i-get-email-address-field-using-the-linkedin-javascript-api)

In your case all you have to do is ensure you checked 'r\_emailaddress' within the 'Default Application Permissions' section of your Linkedin app page.

Then change your getProfileData() function so that it looks like this:

```
function getProfileData() {
   IN.API.Profile("me").fields("first-name", "last-name", "email-address").result(onSuccess).error(onError);
}

```

Documentation on the IN.API.Profile function can be found here:

<https://developer-programs.linkedin.com/documents/inapiprofile>