scgough
scgough

Reputation: 5252

MusicKit API - Playlist Update, Delete, Song Remove

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:

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();

} 

Upvotes: 1

Views: 1109

Answers (1)

Alec Mather
Alec Mather

Reputation: 828

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 :(

Upvotes: 4

Related Questions