Apple Music API: Adding To Collaborative playlist gives 500 error

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:

  1. Create a playlist in your library.
  2. Use the api to add a song.
  3. Confirm that it works.
  4. Make that same playlist collaborative.
  5. Update the playlist ID in your api request (as making a playlist collaborative changes its id)
  6. Confirm that you get the 500 error.
Answered by DTS Engineer in 860978022

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?

Our engineering teams need to investigate this issue, as resolution may involve changes to Apple's software. Please file a bug report, include a small Xcode project and some directions that can be used to reproduce the problem, and post the Feedback number here once you do. If you post the Feedback number here I'll check the status next time I do a sweep of forums posts where I've suggested bug reports.

Bug Reporting: How and Why? has tips on creating your bug report.

Thank you for your response. I submitted a bug report with id FB19992892

Thank you for filing a bug report. It has been routed to the Music API team for investigation. I'll post any news here after they've had a chance to take a look.

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?

Thanks again for your response. I filed an enhancement request with id FB20495670

Apple Music API: Adding To Collaborative playlist gives 500 error
 
 
Q