You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry if this is a dumb question in advance, I'm pretty new to coding in general so don't have the best understanding. I've encountered a Bad Request (400) error when trying to run the get_recommendations and add_tracks_to_playlist functions, but cannot figure out why as other functions seem to be working fine. I've run this syntax before without any issues, but seemingly get an empty vector when I run the get_recommendations argument, and an HTTP 400 error when trying to add things to a playlist. For clarity, here is the relevant part of the syntax I'm having trouble with:
Seeing as I've run this before without issues, I thought it might be something to do with the wrapper or the API? It doesn't make much sense to me as I don't think there is much wrong with the syntax. I'd be grateful for any help/advice!
The text was updated successfully, but these errors were encountered:
Hi,
Sorry if this is a dumb question in advance, I'm pretty new to coding in general so don't have the best understanding. I've encountered a Bad Request (400) error when trying to run the get_recommendations and add_tracks_to_playlist functions, but cannot figure out why as other functions seem to be working fine. I've run this syntax before without any issues, but seemingly get an empty vector when I run the get_recommendations argument, and an HTTP 400 error when trying to add things to a playlist. For clarity, here is the relevant part of the syntax I'm having trouble with:
`# packages
library(spotifyr)
library(lubridate)
library(knitr)
library(httpuv)
Sys.setenv(SPOTIFY_CLIENT_ID = 'MY_CLIENT_ID')
Sys.setenv(SPOTIFY_CLIENT_SECRET = 'MY_CLIENT_SECRET')
access_token <- get_spotify_access_token()
recommendations (no problems in prior use)
recommended_tracks <- get_recommendations(limit = 25, market = "GB", seed_artists = NULL,
seed_genres = "folk", seed_tracks = NULL,
target_acousticness = 0.400, target_danceability = NULL,
target_duration_ms = NULL, target_energy = 0.500,
target_instrumentalness = 0.300, target_popularity = NULL,
target_speechiness = NULL, target_tempo = NULL, target_valence = 0.400,
authorization = get_spotify_access_token(), include_seeds_in_response = FALSE)
create playlist (this bit works fine)
my_playlist <- create_playlist("MY_USERNAME", name = "Test Playlist: Folk", public = TRUE, collaborative = FALSE,
description = "Test", authorization = get_spotify_authorization_code())
add tracks to playlist (this is where the bad request error comes up)
add_tracks_to_playlist(my_playlist$id, uris = recommended_tracks $uri, authorization = get_spotify_authorization_code())`
Seeing as I've run this before without issues, I thought it might be something to do with the wrapper or the API? It doesn't make much sense to me as I don't think there is much wrong with the syntax. I'd be grateful for any help/advice!
The text was updated successfully, but these errors were encountered: