Я вижу другое обсуждение, подобное этим, hovewer Я не могу понять, как получить адрес электронной почты из связанного API, я включил r_emailaddress в своем приложении, вот что я сделал:получить адрес электронной почты, используя связанный API API javascript SDK
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>
и здесь сценарий:
// 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);
}
я хочу, чтобы заполнить поле ввода с data.emailAdress, но я не имею его в объекте, кто-то знает что делать? Спасибо!