Some work on the documentation

This commit is contained in:
Johnny Dellinger @PC 2015-07-23 21:42:34 +02:00
parent 4d77ed6ba0
commit 21c5a19383
10 changed files with 664 additions and 59 deletions

View File

@ -5,15 +5,19 @@
|Name|Description|Example| |Name|Description|Example|
|--------------|-------------------------|-------------------------| |--------------|-------------------------|-------------------------|
|id| The Spotify ID for the album. | EXAMPLE |id| The Spotify ID for the album. | `"5O7V8l4SeXTymVp3IesT9C"`
|limit| The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50. | EXAMPLE |[limit]| The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50. | `20`
|offset| The index of the first track to return. Default: 0 (the first object). | EXAMPLE |[offset]| The index of the first track to return. Default: 0 (the first object). | `0`
|market| An ISO 3166-1 alpha-2 country code. Provide this parameter if you want to apply Track Relinking. | EXAMPLE |[market]| An ISO 3166-1 alpha-2 country code. Provide this parameter if you want to apply Track Relinking. | `"DE"`
Returns a [Public User Model](https://developer.spotify.com/web-api/object-model/#user-object-public) Returns a [SimpleTrack](https://developer.spotify.com/web-api/object-model/#track-object-simplified) wrapped inside a [Paging-object](https://developer.spotify.com/web-api/object-model/#paging-object)
**Usage** **Usage**
```csharp
```cs
Paging<SimpleTrack> tracks = _spotify.GetAlbumTracks("5O7V8l4SeXTymVp3IesT9C");
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
``` ```
--- ---
@ -24,13 +28,15 @@ Returns a [Public User Model](https://developer.spotify.com/web-api/object-model
|Name|Description|Example| |Name|Description|Example|
|--------------|-------------------------|-------------------------| |--------------|-------------------------|-------------------------|
|id| The Spotify ID for the album. | EXAMPLE |id| The Spotify ID for the album. | `5O7V8l4SeXTymVp3IesT9C`
|market| An ISO 3166-1 alpha-2 country code. Provide this parameter if you want to apply Track Relinking. | EXAMPLE |[market]| An ISO 3166-1 alpha-2 country code. Provide this parameter if you want to apply Track Relinking. | `"DE"`
Returns a [Public User Model](https://developer.spotify.com/web-api/object-model/#user-object-public) Returns a [FullAlbum](https://developer.spotify.com/web-api/object-model/#album-object-full)
**Usage** **Usage**
```csharp ```cs
FullAlbum album = _spotify.GetAlbum("5O7V8l4SeXTymVp3IesT9C");
Console.WriteLine(album.Name + "| Popularity: " + album.Popularity); //Display name and Popularity
``` ```
--- ---
@ -41,13 +47,15 @@ Returns a [Public User Model](https://developer.spotify.com/web-api/object-model
|Name|Description|Example| |Name|Description|Example|
|--------------|-------------------------|-------------------------| |--------------|-------------------------|-------------------------|
|ids| A list of the Spotify IDs for the albums. Maximum: 20 IDs. | EXAMPLE |ids| A list of the Spotify IDs for the albums. Maximum: 20 IDs. | `new List<String>() { "5O7V8l4SeXTymVp3IesT9C" }`
|market| An ISO 3166-1 alpha-2 country code. Provide this parameter if you want to apply Track Relinking. | EXAMPLE |[market]| An ISO 3166-1 alpha-2 country code. Provide this parameter if you want to apply Track Relinking. | `"DE"`
Returns a [Public User Model](https://developer.spotify.com/web-api/object-model/#user-object-public) Returns a **SeveralAlbums** which Property "Albums" contains a list of [FullAlbum](https://developer.spotify.com/web-api/object-model/#album-object-full)
**Usage** **Usage**
```csharp ```cs
SeveralAlbums albums = _spotify.GetSeveralAlbums(new List<String>() { "5O7V8l4SeXTymVp3IesT9C" });
Console.WriteLine(albums.Albums[0].Name);
``` ```
--- ---

View File

@ -1,16 +1,19 @@
##GetArtist ##GetArtist
> Get Spotify catalog information for a single artist identified by their unique Spotify ID. > Get Spotify catalog information for a single artist identified by their unique Spotify ID.
**Paramters** **Paramters**
|Name|Description|Example| |Name|Description|Example|
|--------------|-------------------------|-------------------------| |--------------|-------------------------|-------------------------|
|id| The Spotify ID for the artist. | EXAMPLE |id| The Spotify ID for the artist. | `"1KpCi9BOfviCVhmpI4G2sY"`
Returns a [Public User Model](https://developer.spotify.com/web-api/object-model/#user-object-public) Returns a [FullArtist](https://developer.spotify.com/web-api/object-model/#artist-object-full)
**Usage** **Usage**
```csharp ```cs
FullArtist artist = _spotify.GetArtist("1KpCi9BOfviCVhmpI4G2sY");
Console.WriteLine()
``` ```
--- ---
@ -21,12 +24,14 @@ Returns a [Public User Model](https://developer.spotify.com/web-api/object-model
|Name|Description|Example| |Name|Description|Example|
|--------------|-------------------------|-------------------------| |--------------|-------------------------|-------------------------|
|id| The Spotify ID for the artist. | EXAMPLE |id| The Spotify ID for the artist. | `"1KpCi9BOfviCVhmpI4G2sY"`
Returns a [Public User Model](https://developer.spotify.com/web-api/object-model/#user-object-public) Returns a **SeveralArtists** object which contains the property `List<FullArtist> Artists` ([FullArtist](https://developer.spotify.com/web-api/object-model/#artist-object-full))
**Usage** **Usage**
```csharp ```cs
SeveralArtists artists = _spotify.GetRelatedArtists("1KpCi9BOfviCVhmpI4G2sY");
Console.WriteLine(artists.Artists[0].Name);
``` ```
--- ---
@ -37,13 +42,15 @@ Returns a [Public User Model](https://developer.spotify.com/web-api/object-model
|Name|Description|Example| |Name|Description|Example|
|--------------|-------------------------|-------------------------| |--------------|-------------------------|-------------------------|
|id| The Spotify ID for the artist. | EXAMPLE |id| The Spotify ID for the artist. | `"1KpCi9BOfviCVhmpI4G2sY"`
|country| The country: an ISO 3166-1 alpha-2 country code. | EXAMPLE |country| The country: an ISO 3166-1 alpha-2 country code. | `"DE"`
Returns a [Public User Model](https://developer.spotify.com/web-api/object-model/#user-object-public) Returns a **SeveralTracks** object which contains the property `List<FullTrack> Tracks` ([FullTrack](https://developer.spotify.com/web-api/object-model/#track-object-full))
**Usage** **Usage**
```csharp ```cs
SeveralTracks tracks = _spotify.GetArtistsTopTracks("1KpCi9BOfviCVhmpI4G2sY", "DE");
Console.WriteLine(tracks.Tracks.Count); //How many tracks did we get?
``` ```
--- ---
@ -54,16 +61,18 @@ Returns a [Public User Model](https://developer.spotify.com/web-api/object-model
|Name|Description|Example| |Name|Description|Example|
|--------------|-------------------------|-------------------------| |--------------|-------------------------|-------------------------|
|id| The Spotify ID for the artist. | EXAMPLE |id| The Spotify ID for the artist. | `"1KpCi9BOfviCVhmpI4G2sY"`
|type| A list of keywords that will be used to filter the response. If not supplied, all album types will be returned | EXAMPLE |[type]| A list of keywords that will be used to filter the response. If not supplied, all album types will be returned | `AlbumType.All`
|limit| The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50. | EXAMPLE |[limit]| The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50. | `20`
|offset| The index of the first album to return. Default: 0 | EXAMPLE |[offset]| The index of the first album to return. Default: 0 | `0`
|market| An ISO 3166-1 alpha-2 country code. Supply this parameter to limit the response to one particular geographical market | EXAMPLE |[market]| An ISO 3166-1 alpha-2 country code. Supply this parameter to limit the response to one particular geographical market | `"DE"`
Returns a [Public User Model](https://developer.spotify.com/web-api/object-model/#user-object-public) Returns a [SimpleAlbum](https://developer.spotify.com/web-api/object-model/#album-object-simplified) wrapped inside a [Paging-object](https://developer.spotify.com/web-api/object-model/#paging-object)
**Usage** **Usage**
```csharp ```cs
Paging<SimpleAlbum> albums = _spotify.GetArtistsAlbums("1KpCi9BOfviCVhmpI4G2sY", AlbumType.All);
albums.Items.ForEach(album => Console.WriteLine(album.Name));
``` ```
--- ---
@ -74,12 +83,14 @@ Returns a [Public User Model](https://developer.spotify.com/web-api/object-model
|Name|Description|Example| |Name|Description|Example|
|--------------|-------------------------|-------------------------| |--------------|-------------------------|-------------------------|
|ids| A list of the Spotify IDs for the artists. Maximum: 50 IDs. | EXAMPLE |ids| A list of the Spotify IDs for the artists. Maximum: 50 IDs. | `new List<String>() { "1KpCi9BOfviCVhmpI4G2sY" } `
Returns a [Public User Model](https://developer.spotify.com/web-api/object-model/#user-object-public) Returns a **SeveralArtists** object which contains the property `List<FullArtist> Artists` ([FullArtist](https://developer.spotify.com/web-api/object-model/#artist-object-full))
**Usage** **Usage**
```csharp ```cs
SeveralArtists artists = _spotify.GetSeveralArtists(new List<String>() {"1KpCi9BOfviCVhmpI4G2sY"});
artists.Artists.ForEach(artist => Console.WriteLine(artist.Name));
``` ```
--- ---

View File

@ -20,7 +20,7 @@ Now you can start with the User-authentication, Spotify provides 3 ways:
* [ClientCredentialsAuth](/SpotifyWebApi/#implicitgrantauth) (Not Recommended, Server-side code needed, else it's unsecure) * [ClientCredentialsAuth](/SpotifyWebApi/#implicitgrantauth) (Not Recommended, Server-side code needed, else it's unsecure)
**Note:** I would recommend a little PHP Script, which will exchange the Keys using AutorizationCodeAuth. **Note:** I would recommend a little PHP Script, which will exchange the Keys using AutorizationCodeAuth.
When using ImplicitGrantAuth, another user could abuse the "localhost" RedirectUri by creating a "fake"-app which uses your ClientId. When using ImplicitGrantAuth, another user could abuse the "localhost" RedirectUri by creating a "fake"-app which uses your ClientId.
Overview: Overview:
@ -35,7 +35,7 @@ You won't be able to refresh the token. If you want to use the internal Http ser
More info: [here](https://developer.spotify.com/web-api/authorization-guide/#implicit_grant_flow) More info: [here](https://developer.spotify.com/web-api/authorization-guide/#implicit_grant_flow)
```csharp ```
static ImplicitGrantAuth auth; static ImplicitGrantAuth auth;
static void Main(string[] args) static void Main(string[] args)
{ {
@ -61,7 +61,7 @@ static void auth_OnResponseReceivedEvent(Token token, string state, string error
{ {
//stop the http server //stop the http server
auth.StopHttpServer(); auth.StopHttpServer();
var spotify = new SpotifyWebApiClass() var spotify = new SpotifyWebApiClass()
{ {
TokenType = token.TokenType, TokenType = token.TokenType,
@ -81,7 +81,7 @@ A good thing about this method: You can always refresh your token, without havin
More info: [here](https://developer.spotify.com/web-api/authorization-guide/#authorization_code_flow) More info: [here](https://developer.spotify.com/web-api/authorization-guide/#authorization_code_flow)
```csharp ```
static AutorizationCodeAuth auth; static AutorizationCodeAuth auth;
static void Main(string[] args) static void Main(string[] args)
{ {
@ -111,11 +111,11 @@ private static void auth_OnResponseReceivedEvent(AutorizationCodeAuthResponse re
{ {
//Stop the HTTP Server, done. //Stop the HTTP Server, done.
auth.StopHttpServer(); auth.StopHttpServer();
//NEVER DO THIS! You would need to provide the ClientSecret. //NEVER DO THIS! You would need to provide the ClientSecret.
//You would need to do it e.g via a PHP-Script. //You would need to do it e.g via a PHP-Script.
Token token = auth.ExchangeAuthCode(response.Code, "XXXXXXXXXXX"); Token token = auth.ExchangeAuthCode(response.Code, "XXXXXXXXXXX");
var spotify = new SpotifyWebApiClass() var spotify = new SpotifyWebApiClass()
{ {
TokenType = token.TokenType, TokenType = token.TokenType,
@ -135,7 +135,7 @@ If you want to use it securely, you would need to do it all server-side.
More info: [here](https://developer.spotify.com/web-api/authorization-guide/#client_credentials_flow) More info: [here](https://developer.spotify.com/web-api/authorization-guide/#client_credentials_flow)
```csharp ```
static ClientCredentialsAuth auth; static ClientCredentialsAuth auth;
static void Main(string[] args) static void Main(string[] args)
{ {
@ -149,7 +149,7 @@ static void Main(string[] args)
//How many permissions we need? //How many permissions we need?
Scope = Scope.USER_READ_PRIVATE, Scope = Scope.USER_READ_PRIVATE,
}; };
//With this token object, we now can make calls //With this token object, we now can make calls
Token token = auth.DoAuth(); Token token = auth.DoAuth();
var spotify = new SpotifyWebApiClass() var spotify = new SpotifyWebApiClass()
{ {
@ -158,4 +158,4 @@ static void Main(string[] args)
UseAuth = false UseAuth = false
}; };
} }
``` ```

View File

@ -0,0 +1,110 @@
##GetFeaturedPlaylists
<span class="label label-warning">AUTH REQUIRED</span>
> Get a list of Spotify featured playlists (shown, for example, on a Spotify players “Browse” tab).
**Paramters**
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|[locale]| The desired language, consisting of a lowercase ISO 639 language code and an uppercase ISO 3166-1 alpha-2 country code, joined by an underscore. | `"de_DE" //Germany`
|[country]| A country: an ISO 3166-1 alpha-2 country code. | `"DE"`
|[timestamp]| A timestamp in ISO 8601 format | `DateTime.Now`
|[limit]| The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50. | `20`
|[offset]| The index of the first item to return. Default: 0 | `0`
Returns a **FeaturedPlaylists** object, which has 2 properties. `String Message` and `Paging<SimplePlaylist> Playlists`
**Usage**
```cs
FeaturedPlaylists playlists = _spotify.GetFeaturedPlaylists();
Console.WriteLine(playlists.Message);
playlists.Playlists.Items.ForEach(playlist => Console.WriteLine(playlist.Name));
```
---
##GetNewAlbumReleases
<span class="label label-warning">AUTH REQUIRED</span>
> Get a list of new album releases featured in Spotify (shown, for example, on a Spotify players “Browse” tab).
**Paramters**
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|[country]| A country: an ISO 3166-1 alpha-2 country code. | `"DE"`
|[limit]| The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50. | `20`
|[offset]| The index of the first item to return. Default: 0 | `0`
Returns a **NewAlbumReleases** object, which has the property `Paging<SimpleAlbum> Albums`.
**Usage**
```cs
NewAlbumReleases newAlbums = _spotify.GetNewAlbumReleases();
newAlbums.Albums.Items.ForEach(album => Console.WriteLine(album.Name));
```
---
##GetCategories
<span class="label label-warning">AUTH REQUIRED</span>
> Get a list of categories used to tag items in Spotify (on, for example, the Spotify players “Browse” tab).
**Paramters**
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|[country]| A country: an ISO 3166-1 alpha-2 country code. Provide this parameter if you want to narrow the list of returned categories to those relevant to a particular country | `"DE"`
|[locale]| The desired language, consisting of an ISO 639 language code and an ISO 3166-1 alpha-2 country code, joined by an underscore | `"de_DE"`
|[limit]| The maximum number of categories to return. Default: 20. Minimum: 1. Maximum: 50. | `20`
|[offset]| The index of the first item to return. Default: 0 (the first object). | `0`
Returns a **CategoryList** object, which has the property `Paging<Category> Categories`.
**Usage**
```cs
CategoryList categoryList = _spotify.GetCategories();
categoryList.Categories.Items.ForEach(category => Console.WriteLine(category.Name));
```
---
##GetCategory
<span class="label label-warning">AUTH REQUIRED</span>
> Get a single category used to tag items in Spotify (on, for example, the Spotify players “Browse” tab).
**Paramters**
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|categoryId| The Spotify category ID for the category. | `"party"`
|[country]| A country: an ISO 3166-1 alpha-2 country code. Provide this parameter to ensure that the category exists for a particular country. | `"DE"`
|[locale]| The desired language, consisting of an ISO 639 language code and an ISO 3166-1 alpha-2 country code, joined by an underscore | `"de_DE"`
Returns a [Category](https://developer.spotify.com/web-api/object-model/#category-object)
**Usage**
```cs
Category cat = _spotify.GetCategory("party");
Console.WriteLine(cat.Name);
```
---
##GetCategoryPlaylists
<span class="label label-warning">AUTH REQUIRED</span>
> Get a list of Spotify playlists tagged with a particular category.
**Paramters**
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|categoryId| The Spotify category ID for the category. | `"party"`
|[country]| A country: an ISO 3166-1 alpha-2 country code. | `"DE"`
|[limit]| The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50. | `20`
|[offset]| The index of the first item to return. Default: 0 | `0`
Returns a **CategoryPlaylist** object, which has the property `Paging<SimplePlaylist> Playlists`
**Usage**
```cs
CategoryPlaylist playlists = _spotify.GetCategoryPlaylists("party");
playlists.Playlists.Items.ForEach(playlist => Console.WriteLine(playlist.Name));
```
---

View File

@ -0,0 +1,128 @@
##Follow
<span class="label label-warning">AUTH REQUIRED</span>
> Add the current user as a follower of one or more artists or other Spotify users.
**Paramters**
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|followType| The ID type: either artist or user. | `FollowType.Artist`
|ids or id| A list of the artist or the user Spotify IDs or just a Spotify ID | `new List<String> { "1KpCi9BOfviCVhmpI4G2sY" }` or `"1KpCi9BOfviCVhmpI4G2sY"`
Returns a **ErrorResponse** which just contains a possible error. (`response.HasError()` and `response.Error`)
**Usage**
```cs
ErrorResponse response = _spotify.Follow(FollowType.Artist, "1KpCi9BOfviCVhmpI4G2sY");
//or if it's a User
ErrorResponse response = _spotify.Follow(FollowType.User, "1122095781");
```
---
##Unfollow
<span class="label label-warning">AUTH REQUIRED</span>
> Remove the current user as a follower of one or more artists or other Spotify users.
**Paramters**
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|followType| The ID type: either artist or user. | `FollowType.Artist`
|ids or id| A list of the artist or the user Spotify IDs or just a Spotify ID | `new List<String> { "1KpCi9BOfviCVhmpI4G2sY" }` or `"1KpCi9BOfviCVhmpI4G2sY"`
Returns a **ErrorResponse** which just contains a possible error. (`response.HasError()` and `response.Error`)
**Usage**
```cs
ErrorResponse response = _spotify.Unfollow(FollowType.Artist, "1KpCi9BOfviCVhmpI4G2sY");
//or if it's a User
ErrorResponse response = _spotify.Unfollow(FollowType.User, "1122095781");
```
---
##IsFollowing
<span class="label label-warning">AUTH REQUIRED</span>
> Check to see if the current user is following one or more artists or other Spotify users.
**Paramters**
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|followType| The ID type: either artist or user. | `FollowType.Artist`
|ids or id| A list of the artist or the user Spotify IDs or just a Spotify ID | `new List<String> { "1KpCi9BOfviCVhmpI4G2sY" }` or `"1KpCi9BOfviCVhmpI4G2sY"`
Returns a **ListResponse<Boolean>** which contains the property `List<Boolean> List`
**Usage**
```cs
//Are you one of my Followers? :P
ListResponse<Boolean> response = _spotify.IsFollowing(FollowType.User, "1122095781");
Console.WriteLine(response.List[0] ? "Yis!" : "No :(");
```
---
##FollowPlaylist
<span class="label label-warning">AUTH REQUIRED</span>
> Add the current user as a follower of a playlist.
**Paramters**
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|ownerId| The Spotify user ID of the person who owns the playlist. | `"maxloermans"`
|playlistId| The Spotify ID of the playlist. Any playlist can be followed, regardless of its public/private status, as long as you know its playlist ID. | `"3SIp2VAsKI03mReF0dFBmI"`
|[showPublic]| If true the playlist will be included in user's public playlists, if false it will remain private. | `true`
Returns a **ErrorResponse** which just contains a possible error. (`response.HasError()` and `response.Error`)
**Usage**
```cs
ErrorResponse response = _spotify.FollowPlaylist("maxloermans", "3SIp2VAsKI03mReF0dFBmI");
if(!response.HasError())
Console.WriteLine("success");
```
---
##UnfollowPlaylist
<span class="label label-warning">AUTH REQUIRED</span>
> Remove the current user as a follower of a playlist.
**Paramters**
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|ownerId| The Spotify user ID of the person who owns the playlist. | `"maxloermans"`
|playlistId| The Spotify ID of the playlist that is to be no longer followed. | `"3SIp2VAsKI03mReF0dFBmI"`
Returns a **ErrorResponse** which just contains a possible error. (`response.HasError()` and `response.Error`)
**Usage**
```cs
ErrorResponse response = _spotify.UnfollowPlaylist("maxloermans", "3SIp2VAsKI03mReF0dFBmI");
if(!response.HasError())
Console.WriteLine("success");
```
---
##IsFollowingPlaylist
<span class="label label-warning">AUTH REQUIRED</span>
> Check to see if one or more Spotify users are following a specified playlist.
**Paramters**
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|ownerId| The Spotify user ID of the person who owns the playlist. | `"maxloermans"`
|playlistId| The Spotify ID of the playlist. | `"3SIp2VAsKI03mReF0dFBmI"`
|ids or id| A list of the artist or the user Spotify IDs or just a Spotify ID | `new List<String> { "1KpCi9BOfviCVhmpI4G2sY" }` or `"1KpCi9BOfviCVhmpI4G2sY"`
Returns a **ListResponse<Boolean>** which contains the property `List<Boolean> List`
**Usage**
```cs
//Am I following the playlist?
ListResponse<Boolean> response = _spotify.IsFollowing("maxloermans", "3SIp2VAsKI03mReF0dFBmI", "1122095781");
Console.WriteLine(response.List[0] ? "Yis!" : "No :(");
```
---

View File

@ -22,18 +22,18 @@ Full-Method Reference:
##UseAuth ##UseAuth
Wether auth should be used or not. User-stuff can only be fetched with auth. Wether auth should be used or not. User-stuff can only be fetched with auth.
**NOTE:** If you use auth, you need to provide both, `TokenType` and `AccessToken` **NOTE:** If you use auth, you need to provide both, `TokenType` and `AccessToken`
```csharp ```
_spotify.UseAuth = false; _spotify.UseAuth = false;
``` ```
##TokenType ##TokenType
The token-type. Normally "Bearer" or "Basic". The token-type. Normally "Bearer" or "Basic".
```csharp ```
_spotify.TokenType = "XXXXXXXXXXXXXXXX"; _spotify.TokenType = "XXXXXXXXXXXXXXXX";
``` ```
##AccessToken ##AccessToken
The access-token received by your auth-type. The access-token received by your auth-type.
```csharp ```
_spotify.AccessToken = "XXXXXXXXXXXXXXXX"; _spotify.AccessToken = "XXXXXXXXXXXXXXXX";
``` ```

View File

@ -0,0 +1,101 @@
##SaveTracks
<span class="label label-warning">AUTH REQUIRED</span>
> Save one or more tracks to the current users “Your Music” library.
**Paramters**
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|ids| A list of the Spotify IDs | `new List<String> { "3Hvu1pq89D4R0lyPBoujSv" }`
Returns a **ErrorResponse** which just contains a possible error. (`response.HasError()` and `response.Error`)
**Usage**
```cs
ErrorResponse response = _spotify.SaveTracks(new List<string> { "3Hvu1pq89D4R0lyPBoujSv" });
if(!response.HasError())
Console.WriteLine("success");
```
---
##SaveTrack
<span class="label label-warning">AUTH REQUIRED</span>
> Save one track to the current users “Your Music” library.
**Paramters**
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|id| A Spotify ID | `"3Hvu1pq89D4R0lyPBoujSv"`
Returns a **ErrorResponse** which just contains a possible error. (`response.HasError()` and `response.Error`)
**Usage**
```cs
ErrorResponse response = _spotify.SaveTrack("3Hvu1pq89D4R0lyPBoujSv");
if(!response.HasError())
Console.WriteLine("success");
```
---
##GetSavedTracks
<span class="label label-warning">AUTH REQUIRED</span>
> Get a list of the songs saved in the current Spotify users “Your Music” library.
**Paramters**
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|[limit]| The maximum number of objects to return. Default: 20. Minimum: 1. Maximum: 50. | `20`
|[offset]| The index of the first object to return. Default: 0 (i.e., the first object) | `0`
|[market]| An ISO 3166-1 alpha-2 country code. Provide this parameter if you want to apply Track Relinking. | `DE`
Returns a **Paging<SavedTrack>**, **SavedTrack** contains 2 properties, `DateTime AddedAt` and `FullTrack Track`
**Usage**
```cs
Paging<SavedTrack> savedTracks = _spotify.GetSavedTracks();
savedTracks.Items.ForEach(track => Console.WriteLine(track.Track.Name));
```
---
##RemoveSavedTracks
<span class="label label-warning">AUTH REQUIRED</span>
> Remove one or more tracks from the current users “Your Music” library.
**Paramters**
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|ids| A list of the Spotify IDs. | `new List<String> { "3Hvu1pq89D4R0lyPBoujSv" }`
Returns a **ErrorResponse** which just contains a possible error. (`response.HasError()` and `response.Error`)
**Usage**
```cs
ErrorResponse response = _spotify.RemoveSavedTracks(new List<string> { "3Hvu1pq89D4R0lyPBoujSv" });
if(!response.HasError())
Console.WriteLine("success");
```
---
##CheckSavedTracks
<span class="label label-warning">AUTH REQUIRED</span>
> Check if one or more tracks is already saved in the current Spotify users “Your Music” library.
**Paramters**
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|ids| A list of the Spotify IDs. | `new List<String> { "3Hvu1pq89D4R0lyPBoujSv" }`
Returns a **ListResponse<bool>** which contains a property, `List<bool> List`
**Usage**
```cs
ListResponse<bool> tracksSaved = _spotify.CheckSavedTracks(new List<String> { "3Hvu1pq89D4R0lyPBoujSv" });
if(tracksSaved.List[0])
Console.WriteLine("The track is in your library!");
```
---

View File

@ -0,0 +1,219 @@
##GetUserPlaylists
<span class="label label-warning">AUTH REQUIRED</span>
> Get a list of the playlists owned or followed by a Spotify user.
**Paramters**
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|userId| The user's Spotify user ID. | EXAMPLE
|limit| The maximum number of playlists to return. Default: 20. Minimum: 1. Maximum: 50. | EXAMPLE
|offset| The index of the first playlist to return. Default: 0 (the first object) | EXAMPLE
Returns a [Public User Model](https://developer.spotify.com/web-api/object-model/#user-object-public)
**Usage**
```cs
```
---
##GetPlaylist
<span class="label label-warning">AUTH REQUIRED</span>
> Get a playlist owned by a Spotify user.
**Paramters**
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|userId| The user's Spotify user ID. | EXAMPLE
|playlistId| The Spotify ID for the playlist. | EXAMPLE
|fields| Filters for the query: a comma-separated list of the fields to return. If omitted, all fields are returned. | EXAMPLE
|market| An ISO 3166-1 alpha-2 country code. Provide this parameter if you want to apply Track Relinking. | EXAMPLE
Returns a [Public User Model](https://developer.spotify.com/web-api/object-model/#user-object-public)
**Usage**
```cs
```
---
##GetPlaylistTracks
<span class="label label-warning">AUTH REQUIRED</span>
> Get full details of the tracks of a playlist owned by a Spotify user.
**Paramters**
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|userId| The user's Spotify user ID. | EXAMPLE
|playlistId| The Spotify ID for the playlist. | EXAMPLE
|fields| Filters for the query: a comma-separated list of the fields to return. If omitted, all fields are returned. | EXAMPLE
|limit| The maximum number of tracks to return. Default: 100. Minimum: 1. Maximum: 100. | EXAMPLE
|offset| The index of the first object to return. Default: 0 (i.e., the first object) | EXAMPLE
|market| An ISO 3166-1 alpha-2 country code. Provide this parameter if you want to apply Track Relinking. | EXAMPLE
Returns a [Public User Model](https://developer.spotify.com/web-api/object-model/#user-object-public)
**Usage**
```cs
```
---
##CreatePlaylist
<span class="label label-warning">AUTH REQUIRED</span>
> Create a playlist for a Spotify user. (The playlist will be empty until you add tracks.)
**Paramters**
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|userId| The user's Spotify user ID. | EXAMPLE
|playlistName| The name for the new playlist, for example "Your Coolest Playlist". This name does not need to be unique. | EXAMPLE
|isPublic| default true. If true the playlist will be public, if false it will be private. To be able to create private playlists, the user must have granted the playlist-modify-private scope. | EXAMPLE
Returns a [Public User Model](https://developer.spotify.com/web-api/object-model/#user-object-public)
**Usage**
```cs
```
---
##UpdatePlaylist
<span class="label label-warning">AUTH REQUIRED</span>
> Change a playlists name and public/private state. (The user must, of course, own the playlist.)
**Paramters**
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|userId| The user's Spotify user ID. | EXAMPLE
|playlistId| The Spotify ID for the playlist. | EXAMPLE
|newName| The new name for the playlist, for example "My New Playlist Title". | EXAMPLE
|newPublic| If true the playlist will be public, if false it will be private. | EXAMPLE
Returns a [Public User Model](https://developer.spotify.com/web-api/object-model/#user-object-public)
**Usage**
```cs
```
---
##ReplacePlaylistTracks
<span class="label label-warning">AUTH REQUIRED</span>
> Replace all the tracks in a playlist, overwriting its existing tracks. This powerful request can be useful for replacing tracks, re-ordering existing tracks, or clearing the playlist.
**Paramters**
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|userId| The user's Spotify user ID. | EXAMPLE
|playlistId| The Spotify ID for the playlist. | EXAMPLE
|uris| A list of Spotify track URIs to set. A maximum of 100 tracks can be set in one request. | EXAMPLE
Returns a [Public User Model](https://developer.spotify.com/web-api/object-model/#user-object-public)
**Usage**
```cs
```
---
##RemovePlaylistTracks
<span class="label label-warning">AUTH REQUIRED</span>
> Remove one or more tracks from a users playlist.
**Paramters**
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|userId| The user's Spotify user ID. | EXAMPLE
|playlistId| The Spotify ID for the playlist. | EXAMPLE
|uris| array of objects containing Spotify URI strings (and their position in the playlist). A maximum of 100 objects can be sent at once. | EXAMPLE
Returns a [Public User Model](https://developer.spotify.com/web-api/object-model/#user-object-public)
**Usage**
```cs
```
---
##RemovePlaylistTrack
<span class="label label-warning">AUTH REQUIRED</span>
> Remove one or more tracks from a users playlist.
**Paramters**
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|userId| The user's Spotify user ID. | EXAMPLE
|playlistId| The Spotify ID for the playlist. | EXAMPLE
|uri| Spotify URI | EXAMPLE
Returns a [Public User Model](https://developer.spotify.com/web-api/object-model/#user-object-public)
**Usage**
```cs
```
---
##AddPlaylistTracks
<span class="label label-warning">AUTH REQUIRED</span>
> Add one or more tracks to a users playlist.
**Paramters**
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|userId| The user's Spotify user ID. | EXAMPLE
|playlistId| The Spotify ID for the playlist. | EXAMPLE
|uris| A list of Spotify track URIs to add | EXAMPLE
|position| The position to insert the tracks, a zero-based index | EXAMPLE
Returns a [Public User Model](https://developer.spotify.com/web-api/object-model/#user-object-public)
**Usage**
```cs
```
---
##AddPlaylistTrack
<span class="label label-warning">AUTH REQUIRED</span>
> Add one or more tracks to a users playlist.
**Paramters**
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|userId| The user's Spotify user ID. | EXAMPLE
|playlistId| The Spotify ID for the playlist. | EXAMPLE
|uri| A Spotify Track URI | EXAMPLE
|position| The position to insert the tracks, a zero-based index | EXAMPLE
Returns a [Public User Model](https://developer.spotify.com/web-api/object-model/#user-object-public)
**Usage**
```cs
```
---
##ReorderPlaylist
<span class="label label-warning">AUTH REQUIRED</span>
> Reorder a track or a group of tracks in a playlist.
**Paramters**
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|userId| The user's Spotify user ID. | EXAMPLE
|playlistId| The Spotify ID for the playlist. | EXAMPLE
|rangeStart| The position of the first track to be reordered. | EXAMPLE
|insertBefore| The position where the tracks should be inserted. | EXAMPLE
|rangeLength| The amount of tracks to be reordered. Defaults to 1 if not set. | EXAMPLE
|snapshotId| The playlist's snapshot ID against which you want to make the changes. | EXAMPLE
Returns a [Public User Model](https://developer.spotify.com/web-api/object-model/#user-object-public)
**Usage**
```cs
```
---

View File

@ -0,0 +1,23 @@
##SearchItems
> Get Spotify catalog information about artists, albums, tracks or playlists that match a keyword string.
**Paramters**
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|q| The search query's keywords (and optional field filters and operators), for example q=roadhouse+blues. | `"roadhouse+blues"`
|type| A list of item types to search across. | `SearchType.Album`
|[limit]| The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50. | `20`
|[offset]| The index of the first result to return. Default: 0 | `0`
|[market]| An ISO 3166-1 alpha-2 country code or the string from_token. | `"de"`
Returns a **SearchItem** which contains the properties `Paging<SimpleArtist> Artists`,`Paging<FullTrack> Tracks`, `Paging<SimpleAlbum> Albums`. They are filled based on your search-type.
**Usage**
```cs
SearchItem item = _spotify.SearchItems("roadhouse+blues", SearchType.Album);
Console.WriteLine(item.Albums.Total); //How many results are there in total? NOTE: item.Tracks = item.Artists = null
```
---

View File

@ -2,17 +2,22 @@ site_name: 'SpotifyAPI-NET'
theme_dir: 'mytheme' theme_dir: 'mytheme'
pages: pages:
- ['index.md', 'Home'] - ['index.md', 'Home']
- ['SpotifyWebApi/gettingstarted.md', 'SpotifyWebApi', 'Getting started'] - ['SpotifyWebApi/gettingstarted.md', 'SpotifyWebApi', 'Getting started']
- ['SpotifyWebApi/examples.md', 'SpotifyWebApi', 'Examples'] - ['SpotifyWebApi/examples.md', 'SpotifyWebApi', 'Examples']
- ['SpotifyWebApi/auth.md', 'SpotifyWebApi', 'Authentication'] - ['SpotifyWebApi/auth.md', 'SpotifyWebApi', 'Authentication']
- ['SpotifyWebApi/albums.md', 'SpotifyWebApi', '- Albums'] - ['SpotifyWebApi/search.md', 'SpotifyWebApi', '- Search']
- ['SpotifyWebApi/artists.md', 'SpotifyWebApi', '- Artists'] - ['SpotifyWebApi/albums.md', 'SpotifyWebApi', '- Albums']
- ['SpotifyLocalApi/index.md', 'SpotifyLocalApi', 'SpotifyLocalApi'] - ['SpotifyWebApi/artists.md', 'SpotifyWebApi', '- Artists']
- ['SpotifyWebApi/browse.md', 'SpotifyWebApi', '- Browse']
- ['SpotifyWebApi/follow.md', 'SpotifyWebApi', '- Follow']
- ['SpotifyWebApi/library.md', 'SpotifyWebApi', '- Library']
- ['SpotifyWebApi/playlists.md', 'SpotifyWebApi', '- Playlists']
- ['SpotifyLocalApi/index.md', 'SpotifyLocalApi', 'SpotifyLocalApi']
repo_url: 'https://github.com/JohnnyCrazy/SpotifyAPI-NET' repo_url: 'https://github.com/JohnnyCrazy/SpotifyAPI-NET'
site_author: 'JohnnyCrazy' site_author: 'JohnnyCrazy'
site_description: 'API Docs for SpotifyAPI-NET' site_description: 'API Docs for SpotifyAPI-NET'
extra_javascript: extra_javascript:
- '//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js' - '//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js'
- 'highlight.js' - 'highlight.js'
markdown_extensions: markdown_extensions:
- sane_lists - sane_lists