I’m trying to reorder tracks in a playlist in the Amazon Music Web API. There is an Update Playlist Tracks API call, but it requires entryIdAbove and entryIdBelow to be set, so I don’t know what to set those to if I want to reorder tracks at the beginning or end of the playlist.
I have tried leaving the parameters out and it says they are required. If I set them to null, it says that is an invalid string. If I set them to an empty string I get a response with {“moveTracks”:null} and nothing happens.
I’m assuming there is some magical token that can be used to specify the beginning or end of the playlist? I don’t see anything in the documentation.
As I have explored this more, I have figured out that within the constraints of only being able to move one or more tracks within a given playlist, it is possible to always end up with an API call where entryIdAbove and entryIdBelow are set to valid values, so specifying the values for the beginning or end of the playlist is not necessary.
So if you have 3 tracks and want to swap track 1 and track 3, you need two API calls to achieve this, just as it would take two moves to achieve this in a user interface.
For instance, if in the user interface the user moved track 2 into position 1, because you cannot specify track 2 moving to the beginning of the playlist, you would instead specify that track 1 is the track that moved with track 2 being entryIdAbove and track 3 being entryIdBelow.
The one tricky bit is a case where you only have 2 tracks in the playlist and you want to swap their ordering. In this case it seems you can specify track 1 in the entryIds that moved, with track 2 being entryIdAbove and you set track 1 as entryIdBelow and it works.
thank you for your insights and efforts in exploring this design flaw.
I’ve reached out to the team to look into it. I think, either one of the parameters entryIdAbove or entryIdBelow should be optional.