I want to use the Spotify Web API to create a playlist from my javascript web site. First I followed the tutorial "Begginer tutorial" site developer.spotify.com to create authentication, and then I started to set up the playlist creation function:
function createPlaylist() {
console.log('creer Playlist');
console.log(access_token);
var lien = 'http://ift.tt/1KpR293';
$.ajax({
url: lien,
type: 'POST',
dataType: 'json',
data:JSON.stringify(
{
'name': 'NewPlaylist2',
'public': false
}
),
headers:
{
'Authorization': 'Bearer ' + access_token,
'Content-Type': 'application/json'
},
error: function() {alert('La requête n\'a pas abouti');},
success: function() {alert('La requête OK'); }
}); //fin ajax
}; //fin createPlaylist
However, this does not work and returns me the error 403 in the console.
Do you have any idea of when all this can come?
Thank you in advance.
Vincent Leveque
Aucun commentaire:
Enregistrer un commentaire