Created
May 23, 2015 14:47
-
-
Save JFriel/162072a696b39f64d60b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String trackName = '4BYGxv4rxSNcTgT3DsFB9o' //replace this with a call to get the track ID | |
final List<String> tracksToAdd = Arrays.asList("spotify:track:"+trackName); | |
// Index starts at 0 | |
final int insertIndex = 1; | |
final AddTrackToPlaylistRequest request = api.addTracksToPlaylist("thelinmichael", "5ieJqeLJjjI8iJWaxeBLuK", tracksToAdd) | |
.position(insertIndex) | |
.build(); | |
try { | |
request.get(); | |
} catch (Exception e) { | |
System.out.println("Something went wrong!" + e.getMessage()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment