Here I'm passing "Bearer +token" in the header.But still getting Empty oauth2 access token' error. I have even hardcoded token value.still the response is the name instead of "invalid token".
axios.get("https://api.linkedin.com/v2/me",{
headers: {
'Authorization': Bearer ${linkedinToken}
}}).then((response) => {
console.log(response,'details')
firstName = response.data.localizedFirstName;
lastName = response.data.localizedLastName;
console.log('firstname',(firstName));
console.log('lastname',(lastName));
axios.get(`https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~))`,null,
{
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${linkedinToken}`
}
}).then((response) => {
console.log('email',response);
}).catch((error) => {
console.log('error from email api',(error));
})
}).catch((error) => {
console.log(error,'error from name api')
})