I’m writing an c# application to create and manage Collections using the Plex API. I’ve managed to iterate and list my Plex library and Collections, but creating new Collections and adding items to existing collections give me great difficulties.
I managed to create a new Collection in an existing library, but it remains empty. The referenced item is not added to the collection.
(Via code & directly via PostMan, using the Post command)
When I try to add an item to the newly created collection using the url below, I keep getting a Bad Request response.
url: https://{server ip}:32400/library/collections/{ratingKey of collection}/items?uri=server://{serverID}/com.plexapp.plugins.library/library/metadata/{ratingKey of movie}
Via Postman and code. PostMan, PUT and added the x-plex-token to the header. (If I leave that out I get a Unauthorized response) Also tried via POST and adding the token to the url, but that returns a not found response.
Apologies, this was clearly an issue that existed between keyboard & chair…
If somebody comes across this topic with similar issues, the urls I use are 100% correct. I don’t know how, but I somehow got the serverID wrong. If you go to you Plex web interface: https://app.plex.tv/desktop/#!/media/{this long number is your serverID}/
@dane22 Thanks! Didn’t see an example with the collection[0]tag.tag added to it, will look into that one as well. Adding items indeed only work with PUT, POST returns 404 not found.