Skip to content

Commit 74ec750

Browse files
authored
Documentation fixes (#269)
* Readme fix: arguments passed to createPlaylist The user id was missing from the arguments in the readme example. So when trying the example I got a 404. * Update addTracksToPlaylist examples to not use user id This was returning 404s as well
1 parent 3645d1f commit 74ec750

File tree

4 files changed

+3
-4
lines changed

4 files changed

+3
-4
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ spotifyApi.getUserPlaylists('thelinmichael')
402402
});
403403

404404
// Create a private playlist
405-
spotifyApi.createPlaylist('My Cool Playlist', { 'public' : false })
405+
spotifyApi.createPlaylist('thelinmichael', 'My Cool Playlist', { 'public' : false })
406406
.then(function(data) {
407407
console.log('Created playlist!');
408408
}, function(err) {

examples/add-remove-replace-tracks-in-a-playlist.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ spotifyApi
4848
playlistId = data.body['id'];
4949

5050
// Add tracks to the playlist
51-
return spotifyApi.addTracksToPlaylist('thelinmichael', playlistId, [
51+
return spotifyApi.addTracksToPlaylist(playlistId, [
5252
'spotify:track:4iV5W9uYEdYUVa79Axb7Rh',
5353
'spotify:track:6tcfwoGcDjxnSc6etAkDRR',
5454
'spotify:track:4iV5W9uYEdYUVa79Axb7Rh'

examples/add-tracks-to-a-playlist.js

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ spotifyApi
3232
.then(function(data) {
3333
spotifyApi.setAccessToken(data.body['access_token']);
3434
return spotifyApi.addTracksToPlaylist(
35-
'thelinmichael',
3635
'5ieJqeLJjjI8iJWaxeBLuK',
3736
[
3837
'spotify:track:4iV5W9uYEdYUVa79Axb7Rh',

src/spotify-web-api.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ SpotifyWebApi.prototype = {
615615
* @param {string[]} tracks URIs of the tracks to add to the playlist.
616616
* @param {Object} [options] Options, position being the only one.
617617
* @param {requestCallback} [callback] Optional callback method to be called instead of the promise.
618-
* @example addTracksToPlaylist('thelinmichael', '3EsfV6XzCHU8SPNdbnFogK',
618+
* @example addTracksToPlaylist('3EsfV6XzCHU8SPNdbnFogK',
619619
'["spotify:track:4iV5W9uYEdYUVa79Axb7Rh", "spotify:track:1301WleyT98MSxVHPZCA6M"]').then(...)
620620
* @returns {Promise|undefined} A promise that if successful returns an object containing a snapshot_id. If rejected,
621621
* it contains an error object. Not returned if a callback is given.

0 commit comments

Comments
 (0)