I am sending a request to spotify to get an id value from them to use later in a post request.
fetch('https://api.spotify.com/v1/me', {
headers: {
'Authorization': `Bearer ${token}`
}
}).then(response => {
let jsonResponse = response.json();
});
this code returns an object that looks like this when converted to jason using response.json()
Promise {<pending>}__proto__: Promise[[PromiseStatus]]: "resolved"[[PromiseValue]]: Objectdisplay_name: "Jesse James"external_urls: {spotify: "https://open.spotify.com/user/1257754444"}followers: {href: null, total: 3}href: "https://api.spotify.com/v1/users/1257754444"id: "1257754444"images: [{…}]type: "user"uri: "spotify:user:1257754444"__proto__: Object
Now I want to extract the id value out. but when I use console.log( jsonResonse.id ) i get an undefined. How to I get that value?