Posted to tcl by dandy at Tue May 04 17:12:14 GMT 2021view raw

  1.  
  2. For Pause:
  3.  
  4. curl -X "PUT" "https://api.spotify.com/v1/me/player/pause?device_id=d70b*MASKED*c308" -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer BQBTK50*MASKED*gJGJquMgh"
  5.  
  6. This code worls perfect:
  7.  
  8. set spot_url [http::geturl https://api.spotify.com/v1/me/player/pause? -method PUT -query \
  9. [http::formatQuery device_id "d70b*MASKED*c308"] -headers [list Accept \
  10. application/json Content-Type application/json Authorization "Bearer $::access_token"]]
  11.  
  12.  
  13. And for repeat:
  14.  
  15. curl -X "PUT" "https://api.spotify.com/v1/me/player/repeat?state=track&device_id=d70b*MASKED*c308" -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer BQBTK50*MASKED*gJGJquMgh"
  16.  
  17.  
  18.  
  19. I'm trying this:
  20.  
  21. set spot_url [http::geturl https://api.spotify.com/v1/me/player/repeat? \
  22. -method PUT \
  23. -query [http::formatQuery state "track" device_id "d70b*MASKED*c308"] \
  24. -headers [list Accept application/json Content-Type application/json Authorization "Bearer $::access_token"]]
  25.  
  26.  
  27. but get this:
  28.  
  29. {
  30. "error" : {
  31. "status" : 400,
  32. "message" : "Required parameter state missing"
  33. }
  34. }
  35.