Skip to content

Instantly share code, notes, and snippets.

@leemartin
Created December 8, 2018 20:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leemartin/4bf0c87cd0ccf515cebc2893b0cc968e to your computer and use it in GitHub Desktop.
Save leemartin/4bf0c87cd0ccf515cebc2893b0cc968e to your computer and use it in GitHub Desktop.
Create Apple Music Playlist
// initialize axios instance
let apple = axios.create({
baseURL: 'https://api.music.apple.com/v1',
headers: {
'Authorization': `Bearer ${developerToken}`,
'Music-User-Token': `${musicUserToken}`
}
})
// create playlist
apple.post('/me/library/playlists', {
attributes: {
name: "Chris Cornell at City Park on Oct 28, 2011"
},
relationships: {
tracks: {
data: ids
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment