src/spotify-web-api.js
function(playlistId, tracks, options, callback) {
    return WebApiRequest.builder(this.getAccessToken())
      .withPath('/v1/playlists/' + playlistId + '/tracks')
      .withHeaders({ 'Content-Type': 'application/json' })
      .withQueryParameters(options)
      .withBodyParameters({
        uris: tracks
      })
      .build()
      .execute(HttpManager.post, callback);
  }
function(playlistId, tracks, options, callback) {
    return WebApiRequest.builder(this.getAccessToken())
      .withPath('/v1/playlists/' + playlistId + '/tracks')
      .withHeaders({ 'Content-Type': 'application/json' })
      .withQueryParameters(options)
      .withBodyParameters({
        uris: tracks
      })
      .build()
      .execute(HttpManager.post, callback);
  }
function ( playlistId , tracks , options , callback ) { return WebApiRequest . builder ( this . getAccessToken ( ) ) . withPath ( '/v1/playlists/' + playlistId + '/tracks' ) . withHeaders ( { 'Content-Type' : 'application/json' } ) . withQueryParameters ( options ) . withBodyParameters ( { uris : tracks } ) . build ( ) . execute ( HttpManager . post , callback ) ; }
Add tracks to a playlist.
@param {string} playlistId The playlist's ID
@param {string[]} tracks URIs of the tracks to add to the playlist.
@param {Object} [options] Options, position being the only one.
@param {requestCallback} [callback] Optional callback method to be called instead of the promise.
@example addTracksToPlaylist('thelinmichael', '3EsfV6XzCHU8SPNdbnFogK',
'["spotify:track:4iV5W9uYEdYUVa79Axb7Rh", "spotify:track:1301WleyT98MSxVHPZCA6M"]').then(...)
@returns {Promise|undefined} A promise that if successful returns an object containing a snapshot_id. If rejected,
it contains an error object. Not returned if a callback is given.
Add tracks to a playlist .