Announcements

Help Wizard

Step 1

NEXT STEP

Get my top tracks failed (security)

Get my top tracks failed (security)

Im trying to get top tracks of a user that logged in correctly, but the Xml give this status:

"User not registered in the Developer Dashboard"

 

I don't know how to do to get access to the info for any user that is not register as a developer. 

 

The login code:

private spotifyApi: SpotifyWebApi.SpotifyWebApiJs;
private client_id = 'id';
private scope = ['user-top-read','user-read-private', 'user-read-email'];
private redirect_uri = "http://localhost:4200/disk";
private loginUrl = `https://accounts.spotify.com/authorize?client_id=${this.client_id}&redirect_uri=${encodeURIComponent(this.redirect_uri)}&scope=${encodeURIComponent(this.scope.join(' '))}&response_type=token&state=123`;
login() {
window.location.href = this.loginUrl;
}

Code where I access to the most listen tracks:

getMyTracks(time:string){ //time can be short_term - medium or long
this.authService.getApi().getMyTopTracks({
time_range: time,
limit:10,
}).then((data) => {
this.ponerFoto(data.items[0].album.images[0].url)
for (let i = 0; i < data.items.length; i++) {
const cancion = document.getElementById(`cancion${i+1}`) as HTMLInputElement
cancion.innerHTML = `${i+1}. ${data.items[i].name}`;
cancion.addEventListener('click', () => {
this.abrir(data.items[i].uri); //adds song link to spotify
});
}
}, (err) =>{
console.log(err)
//this.logout();
})
}
Reply
1 Reply

Your code isn't the problem at the moment. The problem is the limitation of development mode: https://developer.spotify.com/documentation/web-api/concepts/quota-modes

Suggested posts