C# SDK
Install and start using the C# SDK.
Intro
The Spotify Web API with fixes and improvements from sonallux SDK provides access to the Spotify Web API with fixes and improvements from sonallux REST APIs.
You can use Spotify's Web API to discover music and podcasts, manage your Spotify library, control audio playback, and much more. Browse our available Web API endpoints using the sidebar at left, or via the navigation bar on top of this page on smaller screens.
In order to make successful Web API requests your app will need a valid access token. One can be obtained through OAuth 2.0.
The base URI for all Web API requests is https://api.spotify.com/v1.
Need help? See our Web API for more information, or visit the Spotify for Developers community forum to ask questions and connect with other developers.
Installation
Add the SDK as a project reference into your solution:
dotnet add reference <path-to-sdk>/SpotifyWebApiWithFixesAndImprovementsFromSonallux.csprojQuick Start
Dependency Injection
Register the client with IServiceCollection and resolve it from the container. The HttpClient is managed by IHttpClientFactory. Configure the client's behavior through SpotifyWebApiWithFixesAndImprovementsFromSonalluxClientOptions.
services.AddSpotifyWebApiWithFixesAndImprovementsFromSonalluxClient(options =>
{
options.Oauth20 =
new OAuth2AuthorizationCodeCredentials
{
ClientId = "YOUR_CLIENT_ID",
RedirectUri = "YOUR_REDIRECT_URI",
PromptForAuthorizationCode = (authUrl, ct) => Task.FromResult(""),
};
options.Environment = ServerEnvironment.Production;
// TODO: configure more client options here
});Direct Instantiation
Create the client by passing an HttpClient you manage yourself. Configure the client's behavior through SpotifyWebApiWithFixesAndImprovementsFromSonalluxClientOptions.
var httpClient = new HttpClient();
// TODO: configure more client options here
var options = new SpotifyWebApiWithFixesAndImprovementsFromSonalluxClientOptions
{
Oauth20 = new OAuth2AuthorizationCodeCredentials
{
ClientId = "YOUR_CLIENT_ID",
RedirectUri = "YOUR_REDIRECT_URI",
PromptForAuthorizationCode = (authUrl, ct) => Task.FromResult(""),
},
Environment = ServerEnvironment.Production,
};
var client = new SpotifyWebApiWithFixesAndImprovementsFromSonalluxClient(httpClient, options);
