Can't get some things like "GetUsersTopArtists" to work
See original GitHub issueHi, I have problems with some of the functions that I want to use. Some things like GetPrivateProfile and GetUserPlaylists works good but others like GetUsersTopArtists and GetDevices gives me this error:
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object. at SpotifyTesting.Program.PrintUsefulData(SpotifyWebAPI api) in /home/jesper/CSpoTUI/Program.cs:line 108 at SpotifyTesting.Program.<>c__DisplayClass3_0.<<Main>b__0>d.MoveNext() in /home/jesper/CSpoTUI/Program.cs:line 40 --- End of stack trace from previous location where exception was thrown --- at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__139_1(Object state) at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
I am using code examples from the docs like this one.
Paging<FullTrack> tracks = api.GetUsersTopTracks(); tracks.Items.ForEach(item => Console.WriteLine(item.Name)); //Display all fetched Track-Names (max 20) Console.WriteLine(tracks.Total.ToString());//Display total album track count
I’m also using AutorizationCodeAuth. There is probably something simple but I can’t figure out why some functions don’t work.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)

Top Related StackOverflow Question
Thank you very mush. I think that solves my problems so i close this issue now.
Not possible, you will have to join every value of https://github.com/JohnnyCrazy/SpotifyAPI-NET/blob/e9685ff4c318f23d9062311f6b03653bc43a3b09/SpotifyAPI.Web/Enums/Scope.cs
Example:
Scope.PlaylistModifyPublic | Scope.PlaylistModifyPrivate