I am useing the linkedin Oauth API(my app is fully working and setup correctly with the scopes r_emailaddress) and I can't seem to return email, I can return it with curl but not with my code,
const userEmail = await fetch("https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~))", {
method: "GET",
headers: {
"Authorization": "Bearer " + accessToken,
"Accept": "application/json"
}
});
const userMail = await userEmail.json();
console.log(userMail)
this code returns elements: [ { 'handle~': [Object], handle: 'urn:li:emailAddress:8238802378' } ]
should "elements": [{"handle~": {"emailAddress": "example.dev@gmail.com"},"handle": "urn:li:emailAddress:8238802378"}]