1

I've been looking at the MusicKit functionality for playlists: https://developer.apple.com/documentation/applemusicapi/create_a_new_library_playlist

I'm wondering, can anyone confirm if they have been able to:

  • remove songs from an existing playlist
  • delete a playlist
  • update the title of a playlist

For example, I have tried updating the title of a playlist in c# using the following but the endpoint does exist/accept this. Note the appended playlist ID to the POST URL p.ABC123

using (var client = new HttpClient())
{
    client.DefaultRequestHeaders.Add("Authorization", "Bearer " + [MYDEVTOKEN]);
    client.DefaultRequestHeaders.Add("Music-User-Token", [MYMUSICUSERTOKEN]);


    string _postUri = "https://api.music.apple.com/v1/me/library/playlists/p.ABC123";

    var jsonObject = JObject.FromObject(new
        {
            attributes = new
            {
                name = "Playlist - Edited Title",
                 description = "This is a playlist edit"
            }
        });

        var _content = new StringContent(jsonObject.ToString(), Encoding.UTF8, "application/json");

        var response = await client.PostAsync(_postUri, content: _content);

        string outputContent = await response.Content.ReadAsStringAsync();

} 
scgough
  • 5,099
  • 3
  • 30
  • 48
  • Wondering if you found a way to do this? update/edit/delete a playlist or tracks in a playlist? – zerohedge Mar 26 '19 at 01:14
  • @zerohedge I haven't got any further with this. Looking at Apple's docs, it doesn't seem like the functionality is available yet. – scgough Mar 26 '19 at 09:39
  • Two years in future and still we don’t have that functionality.i had settings on for adding anything I like to my library. Cleaning that and compare with my old iTunes library was a huge pain. I tried to catch what http request Apple does under the hood to remove a song but no luck. Could you try for example change get request for DELETE? – Sebastian Nov 04 '20 at 15:18

1 Answers1

3

It seems as though Apple isn't allowing this functionality.

https://forums.developer.apple.com/thread/107807

They could be doing this as a security precaution. However, Apple doesn't have a great relationship with the developer community, and is most likely doing it to limit people from building applications on top of theirs. (even though they are an extremely expensive API to work with off the bat...)

I wouldn't anticipate getting this functionality any time soon :(

Alec Mather
  • 742
  • 5
  • 20