Created
December 8, 2018 20:26
-
-
Save leemartin/4bf0c87cd0ccf515cebc2893b0cc968e to your computer and use it in GitHub Desktop.
Create Apple Music Playlist
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
// 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