mirror of
https://github.com/Sarsoo/Spotify.NET.git
synced 2025-01-11 14:07:47 +00:00
Finished Web-Docs
This commit is contained in:
parent
21c5a19383
commit
c86ddd8f9d
@ -159,3 +159,5 @@ static void Main(string[] args)
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
#Scopes
|
||||
|
@ -1,4 +1,4 @@
|
||||
#SpotifyWebAPI
|
||||
#Getting started
|
||||
|
||||
This API provides full access to the new SpotifyWebAPI introduced [here](https://developer.spotify.com/web-api/).
|
||||
With it, you can search for Tracks/Albums/Artists and also get User-based information.
|
||||
@ -6,34 +6,117 @@ It's also possible to create new playlists and add tracks to it.
|
||||
|
||||
---
|
||||
|
||||
#Getting started
|
||||
##First steps
|
||||
|
||||
The API features all currently available features and also provides some examples to get things rolling!
|
||||
Full-Method Reference:
|
||||
**Imports**
|
||||
So after you added the API to your project, you may want to add following imports to your files:
|
||||
|
||||
* [Albums](test)
|
||||
```cs
|
||||
using SpotifyAPI.Web; //Base Namespace
|
||||
using SpotifyAPI.Web.Auth; //All Authentication-related classes
|
||||
using SpotifyAPI.Web.Enums; //Enums
|
||||
using SpotifyAPI.Web.Models; //Models for the JSON-responses
|
||||
```
|
||||
|
||||
[Examples](/SpotifyWebApi/examples)
|
||||
**Basic-Usage**
|
||||
Now you can actually start doing calls to the SpotifyAPI, just create a new Instance of SpotifyWebAPI:
|
||||
```cs
|
||||
private static SpotifyWebAPI _spotify;
|
||||
|
||||
public static void Main(String[] args)
|
||||
{
|
||||
_spotify = new SpotifyWebAPI()
|
||||
{
|
||||
UseAuth = false, //This will disable Authentication.
|
||||
}
|
||||
FullTrack track = _spotify.GetTrack("3Hvu1pq89D4R0lyPBoujSv");
|
||||
Console.WriteLine(track.Name); //Yeay! We just printed a tracks name.
|
||||
//...
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
#Properties
|
||||
##Authentication
|
||||
If you look through the available API-Methods, you will soon notice nearly all of them require Authentication.
|
||||
Further infos on how to implement Authentication can be found [here](/SpotifyWebApi/auth)
|
||||
|
||||
##UseAuth
|
||||
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`
|
||||
```
|
||||
_spotify.UseAuth = false;
|
||||
---
|
||||
|
||||
##Examples
|
||||
A list of small examples can be found [here](/SpotifyWebApi/examples). Do you think a specific example is missing? Feel free to open a PR/Issue!
|
||||
|
||||
---
|
||||
|
||||
##Error-Handling
|
||||
Every API-Call returns a reponse-model which consists of base-error model. To check if a specific API-Call was successful, use the following approach:
|
||||
```cs
|
||||
PrivateProfile profile = _spotify.GetPrivateProfile();
|
||||
if (profile.HasError())
|
||||
{
|
||||
Console.WriteLine("Error Status: " + profile.Error.Status);
|
||||
Console.WriteLine("Error Msg: " + profile.Error.Message);
|
||||
}
|
||||
```
|
||||
|
||||
##TokenType
|
||||
The token-type. Normally "Bearer" or "Basic".
|
||||
```
|
||||
_spotify.TokenType = "XXXXXXXXXXXXXXXX";
|
||||
```
|
||||
---
|
||||
|
||||
##AccessToken
|
||||
The access-token received by your auth-type.
|
||||
```
|
||||
_spotify.AccessToken = "XXXXXXXXXXXXXXXX";
|
||||
```
|
||||
##API-Reference
|
||||
|
||||
###Albums
|
||||
* [GetAlbumTracks](/SpotifyWebApi/albums#getalbumtracks)
|
||||
* [GetAlbum](/SpotifyWebApi/albums#getalbum)
|
||||
* [GetSeveralAlbums](/SpotifyWebApi/albums#getseveralalbums)
|
||||
|
||||
###Artists
|
||||
* [GetArtist](/SpotifyWebApi/artists#getartist)
|
||||
* [GetRelatedArtists](/SpotifyWebApi/artists#getrelatedartists)
|
||||
* [GetArtistsTopTracks](/SpotifyWebApi/artists#getartiststoptracks)
|
||||
* [GetArtistsAlbums](/SpotifyWebApi/artists#getartistsalbums)
|
||||
* [GetSeveralArtists](/SpotifyWebApi/artists#getseveralartists)
|
||||
|
||||
###Browse
|
||||
* [GetFeaturedPlaylists](/SpotifyWebApi/browse#getfeaturedplaylists)
|
||||
* [GetNewAlbumReleases](/SpotifyWebApi/browse#getnewalbumreleases)
|
||||
* [GetCategories](/SpotifyWebApi/browse#getcategories)
|
||||
* [GetCategory](/SpotifyWebApi/browse#getcategory)
|
||||
* [GetCategoryPlaylists](/SpotifyWebApi/browse#getcategoryplaylists)
|
||||
|
||||
###Follow
|
||||
* [Follow](/SpotifyWebApi/follow#follow)
|
||||
* [Unfollow](/SpotifyWebApi/follow#unfollow)
|
||||
* [IsFollowing](/SpotifyWebApi/follow#isfollowing)
|
||||
* [FollowPlaylist](/SpotifyWebApi/follow#followplaylist)
|
||||
* [UnfollowPlaylist](/SpotifyWebApi/follow#unfollowplaylist)
|
||||
* [IsFollowingPlaylist](/SpotifyWebApi/follow#isfollowingplaylist)
|
||||
|
||||
###Library
|
||||
* [SaveTracks](/SpotifyWebApi/library#savetracks)
|
||||
* [SaveTrack](/SpotifyWebApi/library#savetrack)
|
||||
* [GetSavedTracks](/SpotifyWebApi/library#getsavedtracks)
|
||||
* [RemoveSavedTracks](/SpotifyWebApi/library#removesavedtracks)
|
||||
* [CheckSavedTracks](/SpotifyWebApi/library#checksavedtracks)
|
||||
|
||||
###Playlists
|
||||
* [GetUserPlaylists](/SpotifyWebApi/playlists#getuserplaylists)
|
||||
* [GetPlaylist](/SpotifyWebApi/playlists#getplaylist)
|
||||
* [GetPlaylistTracks](/SpotifyWebApi/playlists#getplaylisttracks)
|
||||
* [CreatePlaylist](/SpotifyWebApi/playlists#createplaylist)
|
||||
* [UpdatePlaylist](/SpotifyWebApi/playlists#updateplaylist)
|
||||
* [ReplacePlaylistTracks](/SpotifyWebApi/playlists#replaceplaylisttracks)
|
||||
* [RemovePlaylistTracks](/SpotifyWebApi/playlists#removeplaylisttracks)
|
||||
* [RemovePlaylistTrack](/SpotifyWebApi/playlists#removeplaylisttrack)
|
||||
* [AddPlaylistTracks](/SpotifyWebApi/playlists#addplaylisttracks)
|
||||
* [AddPlaylistTrack](/SpotifyWebApi/playlists#addplaylisttrack)
|
||||
* [ReorderPlaylist](/SpotifyWebApi/playlists#reorderplaylist)
|
||||
|
||||
###Profiles
|
||||
* [GetPublicProfile](/SpotifyWebApi/profiles#getpublicprofile)
|
||||
* [GetPrivateProfile](/SpotifyWebApi/profiles#getprivateprofile)
|
||||
|
||||
###Search
|
||||
* [SearchItems](/SpotifyWebApi/search#searchitems)
|
||||
|
||||
###Tracks
|
||||
* [GetSeveralTracks](/SpotifyWebApi/tracks#getseveraltracks)
|
||||
* [GetTrack](/SpotifyWebApi/tracks#gettrack)
|
||||
|
@ -6,14 +6,16 @@
|
||||
|
||||
|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
|
||||
|userId| The user's Spotify user ID. | `"1122095781"`
|
||||
|[limit]| The maximum number of playlists to return. Default: 20. Minimum: 1. Maximum: 50. | `20`
|
||||
|[offset]| The index of the first playlist to return. Default: 0 (the first object) | `0`
|
||||
|
||||
Returns a [Public User Model](https://developer.spotify.com/web-api/object-model/#user-object-public)
|
||||
Returns a [SimplePlaylist](https://developer.spotify.com/web-api/object-model/#playlist-object-simplified) wrapped inside a [Paging Object](https://developer.spotify.com/web-api/object-model/#paging-object)
|
||||
|
||||
**Usage**
|
||||
```cs
|
||||
Paging<SimplePlaylist> userPlaylists = _spotify.GetUserPlaylists("1122095781");
|
||||
userPlaylists.Items.ForEach(playlist => playlist.Owner.DisplayName) //Who is the owner of the playlist?
|
||||
```
|
||||
|
||||
---
|
||||
@ -25,15 +27,17 @@ Returns a [Public User Model](https://developer.spotify.com/web-api/object-model
|
||||
|
||||
|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
|
||||
|userId| The user's Spotify user ID. | `"1122095781"`
|
||||
|playlistId| The Spotify ID for the playlist. | `"1TtEejT1y4D1WmcOnLfha2"`
|
||||
|[fields]| Filters for the query: a comma-separated list of the fields to return. If omitted, all fields are returned. | `"description,uri"`
|
||||
|[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 [FullTrack](https://developer.spotify.com/web-api/object-model/#track-object-full)
|
||||
|
||||
**Usage**
|
||||
```cs
|
||||
FullPlaylist playlist = _spotify.GetPlaylist("1122095781", "1TtEejT1y4D1WmcOnLfha2");
|
||||
playlist.Tracks.Items.ForEach(track => Console.WriteLine(track.Track.Name));
|
||||
```
|
||||
|
||||
---
|
||||
@ -45,17 +49,19 @@ Returns a [Public User Model](https://developer.spotify.com/web-api/object-model
|
||||
|
||||
|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
|
||||
|userId| The user's Spotify user ID. | `"1122095781"`
|
||||
|playlistId| The Spotify ID for the playlist. | `"1TtEejT1y4D1WmcOnLfha2"`
|
||||
|[fields]| Filters for the query: a comma-separated list of the fields to return. If omitted, all fields are returned. | `"description,uri"`
|
||||
|[limit]| The maximum number of tracks to return. Default: 100. Minimum: 1. Maximum: 100. | `100`
|
||||
|[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 [Public User Model](https://developer.spotify.com/web-api/object-model/#user-object-public)
|
||||
Returns a [PlaylistTrack](https://developer.spotify.com/web-api/object-model/#playlist-object-simplified) wrapped inside a [Paging Object](https://developer.spotify.com/web-api/object-model/#paging-object)
|
||||
|
||||
**Usage**
|
||||
```cs
|
||||
Paging<PlaylistTrack> playlist = _spotify.GetPlaylistTracks("1122095781", "1TtEejT1y4D1WmcOnLfha2");
|
||||
playlist.Items.ForEach(track => Console.WriteLine(track.Track.Name));
|
||||
```
|
||||
|
||||
---
|
||||
@ -67,14 +73,17 @@ Returns a [Public User Model](https://developer.spotify.com/web-api/object-model
|
||||
|
||||
|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
|
||||
|userId| The user's Spotify user ID. | `"1122095781"`
|
||||
|playlistName| The name for the new playlist, for example "Your Coolest Playlist". This name does not need to be unique. | `"This is my new Playlist"`
|
||||
|[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. | `true`
|
||||
|
||||
Returns a [Public User Model](https://developer.spotify.com/web-api/object-model/#user-object-public)
|
||||
Returns a [FullPlaylist](https://developer.spotify.com/web-api/object-model/#playlist-object-full)
|
||||
|
||||
**Usage**
|
||||
```cs
|
||||
FullPlaylist playlist = _spotify.CreatePlaylist("1122095781", "This is my new Playlist");
|
||||
if(!playlist.HasError())
|
||||
Console.WriteLine("Playlist-URI: " + playlist.Uri);
|
||||
```
|
||||
|
||||
---
|
||||
@ -86,34 +95,40 @@ Returns a [Public User Model](https://developer.spotify.com/web-api/object-model
|
||||
|
||||
|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
|
||||
|userId| The user's Spotify user ID. | `"1122095781"`
|
||||
|playlistId| The Spotify ID for the playlist. | `"1TtEejT1y4D1WmcOnLfha2"`
|
||||
|[newName]| The new name for the playlist, for example "My New Playlist Title". | `"New Playlistname"`
|
||||
|[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)
|
||||
Returns a **ErrorResponse** which just contains a possible error. (`response.HasError()` and `response.Error`)
|
||||
|
||||
**Usage**
|
||||
```cs
|
||||
ErrorResponse response = _spotify.UpdatePlaylist("1122095781", "1TtEejT1y4D1WmcOnLfha2", "New Name", true);
|
||||
if(!response.HasError())
|
||||
Console.WriteLine("success");
|
||||
```
|
||||
|
||||
---
|
||||
##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.
|
||||
> 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
|
||||
|userId| The user's Spotify user ID. | `"1122095781"`
|
||||
|playlistId| The Spotify ID for the playlist. | `"1TtEejT1y4D1WmcOnLfha2"`
|
||||
|uris| A list of Spotify track URIs to set. A maximum of 100 tracks can be set in one request. | `new List<string> { "1ri6UZpjPLmTCswIXZ6Uq1" }`
|
||||
|
||||
Returns a [Public User Model](https://developer.spotify.com/web-api/object-model/#user-object-public)
|
||||
Returns a **ErrorResponse** which just contains a possible error. (`response.HasError()` and `response.Error`)
|
||||
|
||||
**Usage**
|
||||
```cs
|
||||
ErrorResponse response = _spotify.ReplacePlaylistTracks("1122095781", "1TtEejT1y4D1WmcOnLfha2", new List<string> { "1ri6UZpjPLmTCswIXZ6Uq1" });
|
||||
if(!response.HasError())
|
||||
Console.WriteLine("success");
|
||||
```
|
||||
|
||||
---
|
||||
@ -125,14 +140,26 @@ Returns a [Public User Model](https://developer.spotify.com/web-api/object-model
|
||||
|
||||
|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
|
||||
|userId| The user's Spotify user ID. | `"1122095781"`
|
||||
|playlistId| The Spotify ID for the playlist. | `"1TtEejT1y4D1WmcOnLfha2"`
|
||||
|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 below)`
|
||||
|
||||
Returns a [Public User Model](https://developer.spotify.com/web-api/object-model/#user-object-public)
|
||||
Returns a **ErrorResponse** which just contains a possible error. (`response.HasError()` and `response.Error`)
|
||||
|
||||
**Usage**
|
||||
```cs
|
||||
//Remove multiple tracks
|
||||
ErrorResponse playlist = _spotify.RemovePlaylistTracks("1122095781", "1TtEejT1y4D1WmcOnLfha2", new List<DeleteTrackUri>()
|
||||
{
|
||||
new DeleteTrackUri("1ri6UZpjPLmTCswIXZ6Uq1"),
|
||||
new DeleteTrackUri("47xtGU3vht7mXLHqnbaau5")
|
||||
});
|
||||
//Remove multiple tracks at their specified positions
|
||||
ErrorResponse playlist = _spotify.RemovePlaylistTracks("1122095781", "1TtEejT1y4D1WmcOnLfha2", new List<DeleteTrackUri>()
|
||||
{
|
||||
new DeleteTrackUri("1ri6UZpjPLmTCswIXZ6Uq1", 2),
|
||||
new DeleteTrackUri("47xtGU3vht7mXLHqnbaau5", 0, 50)
|
||||
});
|
||||
```
|
||||
|
||||
---
|
||||
@ -144,14 +171,19 @@ Returns a [Public User Model](https://developer.spotify.com/web-api/object-model
|
||||
|
||||
|Name|Description|Example|
|
||||
|--------------|-------------------------|-------------------------|
|
||||
|userId| The user's Spotify user ID. | EXAMPLE
|
||||
|playlistId| The Spotify ID for the playlist. | EXAMPLE
|
||||
|uri| Spotify URI | EXAMPLE
|
||||
|userId| The user's Spotify user ID. | `"1122095781"`
|
||||
|playlistId| The Spotify ID for the playlist. | `"1TtEejT1y4D1WmcOnLfha2"`
|
||||
|uri| Spotify URI | `new DeleteTrackUri("1ri6UZpjPLmTCswIXZ6Uq1")`
|
||||
|
||||
Returns a **ErrorResponse** which just contains a possible error. (`response.HasError()` and `response.Error`)
|
||||
|
||||
Returns a [Public User Model](https://developer.spotify.com/web-api/object-model/#user-object-public)
|
||||
|
||||
**Usage**
|
||||
```cs
|
||||
//Remove all tracks with the specified URI
|
||||
ErrorResponse response = _spotify.RemovePlaylistTrack("1122095781", "1TtEejT1y4D1WmcOnLfha2", new DeleteTrackUri("1ri6UZpjPLmTCswIXZ6Uq1"));
|
||||
//Remove all tracks with the specified URI and the specified positions
|
||||
ErrorResponse response = _spotify.RemovePlaylistTrack("1122095781", "1TtEejT1y4D1WmcOnLfha2", new DeleteTrackUri("1ri6UZpjPLmTCswIXZ6Uq1", 0, 10, 20));
|
||||
```
|
||||
|
||||
---
|
||||
@ -163,15 +195,18 @@ Returns a [Public User Model](https://developer.spotify.com/web-api/object-model
|
||||
|
||||
|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
|
||||
|userId| The user's Spotify user ID. | `"1122095781"`
|
||||
|playlistId| The Spotify ID for the playlist. | `"1TtEejT1y4D1WmcOnLfha2"`
|
||||
|uris| A list of Spotify track URIs to add | `new List<string> { "1ri6UZpjPLmTCswIXZ6Uq1" }`
|
||||
|[position]| The position to insert the tracks, a zero-based index | `10`
|
||||
|
||||
Returns a [Public User Model](https://developer.spotify.com/web-api/object-model/#user-object-public)
|
||||
Returns a **ErrorResponse** which just contains a possible error. (`response.HasError()` and `response.Error`)
|
||||
|
||||
**Usage**
|
||||
```cs
|
||||
ErrorResponse response = _spotify.AddPlaylistTracks("1122095781", "1TtEejT1y4D1WmcOnLfha2", new List<string> { "1ri6UZpjPLmTCswIXZ6Uq1" });
|
||||
if(!response.HasError())
|
||||
Console.WriteLine("Success");
|
||||
```
|
||||
|
||||
---
|
||||
@ -183,37 +218,43 @@ Returns a [Public User Model](https://developer.spotify.com/web-api/object-model
|
||||
|
||||
|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
|
||||
|userId| The user's Spotify user ID. | `"1122095781"`
|
||||
|playlistId| The Spotify ID for the playlist. | `"1TtEejT1y4D1WmcOnLfha2"`
|
||||
|uri| A Spotify Track URI | `"1ri6UZpjPLmTCswIXZ6Uq1"`
|
||||
|position| The position to insert the tracks, a zero-based index | `10`
|
||||
|
||||
Returns a [Public User Model](https://developer.spotify.com/web-api/object-model/#user-object-public)
|
||||
Returns a **ErrorResponse** which just contains a possible error. (`response.HasError()` and `response.Error`)
|
||||
|
||||
**Usage**
|
||||
```cs
|
||||
ErrorResponse response = _spotify.AddPlaylistTrack("1122095781", "1TtEejT1y4D1WmcOnLfha2", "1ri6UZpjPLmTCswIXZ6Uq1");
|
||||
if(!response.HasError())
|
||||
Console.WriteLine("Success");
|
||||
```
|
||||
|
||||
---
|
||||
##ReorderPlaylist
|
||||
<span class="label label-warning">AUTH REQUIRED</span>
|
||||
> Reorder a track or a group of tracks in a playlist.
|
||||
> More Info: [Reorder-Playlist](https://developer.spotify.com/web-api/reorder-playlists-tracks/)
|
||||
|
||||
**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
|
||||
|userId| The user's Spotify user ID. | `"1122095781"`
|
||||
|playlistId| The Spotify ID for the playlist. | `"1TtEejT1y4D1WmcOnLfha2"`
|
||||
|rangeStart| The position of the first track to be reordered. | `2`
|
||||
|insertBefore| The position where the tracks should be inserted. | `0`
|
||||
|[rangeLength]| The amount of tracks to be reordered. Defaults to 1 if not set. | `2`
|
||||
|[snapshotId]| The playlist's snapshot ID against which you want to make the changes. | ``
|
||||
|
||||
Returns a [Public User Model](https://developer.spotify.com/web-api/object-model/#user-object-public)
|
||||
Returns a **Snapshot**-Object which contains the property `String SnapshotId`
|
||||
|
||||
**Usage**
|
||||
```cs
|
||||
Snapshot snapshot = _spotify.ReorderPlaylist("1122095781", "1TtEejT1y4D1WmcOnLfha2", 2, 0, 2);
|
||||
Console.WriteLine("New SnapshotId: " + snapshot.SnapshotId);
|
||||
```
|
||||
|
||||
---
|
||||
|
36
docs/SpotifyWebApi/profiles.md
Normal file
36
docs/SpotifyWebApi/profiles.md
Normal file
@ -0,0 +1,36 @@
|
||||
##GetPrivateProfile
|
||||
<span class="label label-warning">AUTH REQUIRED</span>
|
||||
> Get detailed profile information about the current user (including the current user’s username).
|
||||
|
||||
**Paramters**
|
||||
|
||||
|Name|Description|Example|
|
||||
|--------------|-------------------------|-------------------------|
|
||||
|
||||
Returns a [PrivateProfile](https://developer.spotify.com/web-api/object-model/#user-object-private)
|
||||
|
||||
**Usage**
|
||||
```cs
|
||||
PrivateUser user = _spotify.GetPrivateProfile();
|
||||
Console.WriteLine(user.DisplayName);
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
##GetPublicProfile
|
||||
|
||||
> Get public profile information about a Spotify user.
|
||||
|
||||
**Paramters**
|
||||
|
||||
|Name|Description|Example|
|
||||
|--------------|-------------------------|-------------------------|
|
||||
|userId| The user's Spotify user ID. | EXAMPLE
|
||||
|
||||
Returns a [PublicProfile](https://developer.spotify.com/web-api/object-model/#user-object-public)
|
||||
|
||||
**Usage**
|
||||
```cs
|
||||
```
|
||||
|
||||
---
|
40
docs/SpotifyWebApi/tracks.md
Normal file
40
docs/SpotifyWebApi/tracks.md
Normal file
@ -0,0 +1,40 @@
|
||||
##GetSeveralTracks
|
||||
|
||||
> Get Spotify catalog information for multiple tracks based on their Spotify IDs.
|
||||
|
||||
**Paramters**
|
||||
|
||||
|Name|Description|Example|
|
||||
|--------------|-------------------------|-------------------------|
|
||||
|ids| A list of the Spotify IDs for the tracks. Maximum: 50 IDs. | `new List<String> {"6Y1CLPwYe7zvI8PJiWVz6T"}`
|
||||
|market| An ISO 3166-1 alpha-2 country code. Provide this parameter if you want to apply Track Relinking. | `"DE"`
|
||||
|
||||
Returns a **SeveralTracks** object which has one property, `List<FullTrack> Tracks`
|
||||
|
||||
**Usage**
|
||||
```cs
|
||||
SeveralTracks severalTracks = _spotify.GetSeveralTracks(new List<String> {"6Y1CLPwYe7zvI8PJiWVz6T"});
|
||||
severalTracks.Tracks.ForEach(track => Console.WriteLine(track.Name));
|
||||
```
|
||||
|
||||
---
|
||||
##GetTrack
|
||||
|
||||
> Get Spotify catalog information for a single track identified by its unique Spotify ID.
|
||||
|
||||
**Paramters**
|
||||
|
||||
|Name|Description|Example|
|
||||
|--------------|-------------------------|-------------------------|
|
||||
|id| The Spotify ID for the track. | `"6Y1CLPwYe7zvI8PJiWVz6T"`
|
||||
|market| An ISO 3166-1 alpha-2 country code. Provide this parameter if you want to apply Track Relinking. | `"DE"`
|
||||
|
||||
Returns a [FullTrack](https://developer.spotify.com/web-api/object-model/#track-object-full)
|
||||
|
||||
**Usage**
|
||||
```cs
|
||||
FullTrack track = _spotify.GetTrack("6Y1CLPwYe7zvI8PJiWVz6T");
|
||||
Console.WriteLine(track.Name);
|
||||
```
|
||||
|
||||
---
|
@ -1 +1,32 @@
|
||||
# SpotifyAPI-NET Documentation
|
||||
# SpotifyAPI-NET Documentation
|
||||
|
||||
##About
|
||||
This Library, written in C#/.NET, combines two independent SpotifyAPIs into one.
|
||||
|
||||
**Spotify's Web API** ([link](https://developer.spotify.com/web-api/))
|
||||
> Based on simple REST principles, our Web API endpoints return metadata in JSON format about artists, albums, and tracks directly from the Spotify catalogue.
|
||||
> The API also provides access to user-related data such as playlists and music saved in a “Your Music” library, subject to user’s authorization.
|
||||
|
||||
**Spotify's *unofficial* Local API**
|
||||
> Do you ever wanted to control your local Spotify Client with some sort of API? Now you can! This API gives you full control over your spotify client.
|
||||
> You can get infos about the currently playing song, get its Album-Art, skip/pause and much more. It also features multiple Event-Interfaces.
|
||||
|
||||
Both combined can be used for any kind of application.
|
||||
|
||||
---
|
||||
|
||||
##Installing
|
||||
* Via NuGet Package:
|
||||
```cs
|
||||
Install-Package SpotifyAPI-NET
|
||||
//or
|
||||
Install-Package SpotifyAPI-NET -pre
|
||||
```
|
||||
* Download the latest binaries on the [GitHub Release Page](https://github.com/JohnnyCrazy/SpotifyAPI-NET/releases) and add it to your Project
|
||||
* Clone the Repo and build the project on your local machine.
|
||||
|
||||
---
|
||||
|
||||
##Projects
|
||||
|
||||
--
|
||||
|
22
mkdocs.yml
22
mkdocs.yml
@ -2,16 +2,18 @@ site_name: 'SpotifyAPI-NET'
|
||||
theme_dir: 'mytheme'
|
||||
pages:
|
||||
- ['index.md', 'Home']
|
||||
- ['SpotifyWebApi/gettingstarted.md', 'SpotifyWebApi', 'Getting started']
|
||||
- ['SpotifyWebApi/examples.md', 'SpotifyWebApi', 'Examples']
|
||||
- ['SpotifyWebApi/auth.md', 'SpotifyWebApi', 'Authentication']
|
||||
- ['SpotifyWebApi/search.md', 'SpotifyWebApi', '- Search']
|
||||
- ['SpotifyWebApi/albums.md', 'SpotifyWebApi', '- Albums']
|
||||
- ['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']
|
||||
- ['SpotifyWebAPI/gettingstarted.md', 'SpotifyWebAPI', 'Getting started']
|
||||
- ['SpotifyWebAPI/examples.md', 'SpotifyWebAPI', 'Examples']
|
||||
- ['SpotifyWebAPI/auth.md', 'SpotifyWebAPI', 'Authentication']
|
||||
- ['SpotifyWebAPI/albums.md', 'SpotifyWebAPI', '- Albums']
|
||||
- ['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']
|
||||
- ['SpotifyWebAPI/profiles.md', 'SpotifyWebAPI', '- Profiles']
|
||||
- ['SpotifyWebAPI/search.md', 'SpotifyWebAPI', '- Search']
|
||||
- ['SpotifyWebAPI/tracks.md', 'SpotifyWebAPI', '- Tracks']
|
||||
- ['SpotifyLocalApi/index.md', 'SpotifyLocalApi', 'SpotifyLocalApi']
|
||||
repo_url: 'https://github.com/JohnnyCrazy/SpotifyAPI-NET'
|
||||
site_author: 'JohnnyCrazy'
|
||||
|
Loading…
Reference in New Issue
Block a user