spotify-web-api-js icon indicating copy to clipboard operation
spotify-web-api-js copied to clipboard

Add to saved tracks seems to have changed

Open RuurdBijlsma opened this issue 4 months ago • 0 comments

Describe the bug I'm using spotify.api.addToMySavedTracks, but i get a network error (status 400) in the console:

responseText: "{\"error\": {\"status\": 400, \"message\": \"Missing required field: ids\" } }"

It seems that this package sends as payload just an array of ids, but spotify expects this format:

{
    "ids": [
        "string"
    ]
}

To Reproduce Steps to reproduce the behavior:

  1. Run code spotify.api.addToMySavedTracks([id])
  2. See network error 400 as described above

Expected behavior I expect it to not error and use {ids:[]} as request payload

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: windows
  • Browser chrome (electron)
  • Version 1.5.2

I'll try to make a pr for it

Source: https://developer.spotify.com/documentation/web-api/reference/save-tracks-user

RuurdBijlsma avatar Sep 30 '24 19:09 RuurdBijlsma