I am using https://developer.apple.com/documentation/applemusicapi/add-tracks-to-a-library-playlist to add tracks to playlists. This endpoint works fine for all playlists except for collaborative playlists. For collaborative playlist I get the following 500 error as a response:
"errors": [
{
"id": "<some id>",
"title": "Upstream Service Error",
"detail": "Unable to update tracks",
"status": "500",
"code": "50001"
}
]
}
Steps to reproduce:
- Create a playlist in your library.
- Use the api to add a song.
- Confirm that it works.
- Make that same playlist collaborative.
- Update the playlist ID in your api request (as making a playlist collaborative changes its id)
- Confirm that you get the 500 error.
Hello. Before attempting to modify a playlist you must first check the canEdit
attribute (see https://developer.apple.com/documentation/applemusicapi/libraryplaylists/attributes-data.dictionary) to discover if it is possible to modify the playlist. If canEdit
is false then attempts to modify the playlist will return an error.
In the current version of these APIs, collaborative playlists aways have canEdit
set to false. If you would like Apple to consider adding the ability to modify collaborative playlists please file an enhancement request asking for this functionality.
You can file an enhancement request using the Feedback Assistant. If you file a request, please post the Feedback number here.
If you're not familiar with how to file enhancement requests, take a look at Bug Reporting: How and Why?