public Playlist PostPlays(PlaylistPronta playlistPronta, string access_token, string userId) { Tracks play = new Tracks(); List <Track> items = new List <Track>(); string json2 = "{\"uris\":["; string pedacoJson2 = "\"spotify:track:"; string outropedaco = ""; for (int i = 0; i < playlistPronta.audios.Count(); i++) { var t = new Track(); t.FullTrack = playlistPronta.audios[i].FullTrack; items.Add(t); if (i == playlistPronta.audios.Count() - 1) { outropedaco = outropedaco + pedacoJson2 + t.FullTrack.Id; } else { outropedaco = outropedaco + pedacoJson2 + t.FullTrack.Id + "\","; } } play.Items = items; string url = "https://api.spotify.com/v1/users/" + userId + "/playlists"; string json = "{\"name\":\"" + playlistPronta.Nome + "\",\"description\":\"Playlist gerada por algoritmo usando IA\", \"public\": false}"; Playlist playlist = _spotifyApi.PostSpotifyType <Playlist>(url, access_token, json); string url2 = url + "/" + playlist.Id + "/tracks"; json2 = json2 + outropedaco + "\"]}"; Tracks tracks = _spotifyApi.PostSpotifyType <Tracks>(url2, access_token, json2); return(playlist); }