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.
I have been trying to get my top tracks using this in Typescript:
async getDefault2(){
let tracks = await this.authService.getApi().getMyTopTracks({
time_range: "medium_term",
});
console.log(tracks)
}
The strange part is that the only method that is actually working is getMe() and I don't know why! I always get a 403 error!
Solved! Go to Solution.
You are missing the user-top-read Scope.
(I assume you have Authorization implemented.)
Can you please post code of how you get an Access Token?
First the login:
window.location.href = `https://accounts.spotify.com/authorize?client_id=${client_id}&redirect_uri=${redirect_uri}&response_type=token&show_dialog=true`;
Then when I get redirected, I get the token like this:
const token = this.route.snapshot.fragment.split('&')
.find(fragment => fragment.includes('access_token'))
.split('=')[1];
this.spotifyApi.setAccessToken(token);
I am using 'spotify-web-api-js' library.
You are missing the user-top-read Scope.
(I assume you have Authorization implemented.)
Thanks, that just worked fine!
i already added that scope but still not working
@oozkanneray are you using an Authorization method other than Client Credentials? Because with that method, it won't work.
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…