Type in your question below and we'll check to see what answers we can find...
Loading article...
Submitting...
If you couldn't find any answers in the previous step then we need to post your question in the community and wait for someone to respond. You'll be notified when that happens.
Simply add some detail to your question and refine the title if needed, choose the relevant category, then post.
Before we can post your question we need you to quickly make an account (or sign in if you already have one).
Don't worry - it's quick and painless! Just click below, and once you're logged in we'll bring you right back here and post your question. We'll remember what you've already typed in so you won't have to do it again.
When making an API call to
useEffect(() => {
getUsersFavoriteTracks();
}, []);
const getUsersFavoriteTracks = async () => {
const { data } = await axios.get(
"https://api.spotify.com/v1/search",
{
headers: {
Authorization: `Bearer ${token}`,
},
params: {
q: "Hotel Surrender",
type: "album",
},
}
);
console.log(data);
const { data2 } = await axios.get("https://api.spotify.com/v1/me/top/", {
headers: {
Authorization: `Bearer ${token}`,
},
params: {
type: "artists",
},
});
console.log(data2);
};
Solved! Go to Solution.
&20 is a space, but it just needs to be a user-to-read, without encoding the - symbols.
Did you get the access token by following the Authorization Code Flow?
Also, did you request it by using the Authorization Scope "user-top-read"?
Thanks Ximzend for narrowing it down, I didn't set the authorization scope.
If you could imagine this is my href to authenticate, how can I properly use the user-top-read?
&20 is a space, but it just needs to be a user-to-read, without encoding the - symbols.
Thanks Ximzend, problem solved.
Hey there you, Yeah, you! 😁 Welcome - we're glad you joined the Spotify Community! While you here, let's have a fun game and get…