import 'package:spotify_openapi/api.dart';
All URIs are relative to https://api.spotify.com/v1
Method | HTTP request | Description |
---|---|---|
addTracksToPlaylist | POST /playlists/{playlist_id}/tracks | Add Items to Playlist |
changePlaylistDetails | PUT /playlists/{playlist_id} | Change Playlist Details |
checkIfUserFollowsPlaylist | GET /playlists/{playlist_id}/followers/contains | Check if Users Follow Playlist |
createPlaylist | POST /users/{user_id}/playlists | Create Playlist |
followPlaylist | PUT /playlists/{playlist_id}/followers | Follow Playlist |
getACategoriesPlaylists | GET /browse/categories/{category_id}/playlists | Get Category's Playlists |
getAListOfCurrentUsersPlaylists | GET /me/playlists | Get Current User's Playlists |
getFeaturedPlaylists | GET /browse/featured-playlists | Get Featured Playlists |
getListUsersPlaylists | GET /users/{user_id}/playlists | Get User's Playlists |
getPlaylist | GET /playlists/{playlist_id} | Get Playlist |
getPlaylistCover | GET /playlists/{playlist_id}/images | Get Playlist Cover Image |
getPlaylistsTracks | GET /playlists/{playlist_id}/tracks | Get Playlist Items |
removeTracksPlaylist | DELETE /playlists/{playlist_id}/tracks | Remove Playlist Items |
reorderOrReplacePlaylistsTracks | PUT /playlists/{playlist_id}/tracks | Update Playlist Items |
unfollowPlaylist | DELETE /playlists/{playlist_id}/followers | Unfollow Playlist |
uploadCustomPlaylistCover | PUT /playlists/{playlist_id}/images | Add Custom Playlist Cover Image |
ReorderOrReplacePlaylistsTracks200Response addTracksToPlaylist(playlistId, position, uris, requestBody)
Add Items to Playlist
Add one or more items to a user's playlist.
import 'package:spotify_openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: oauth_2_0
//defaultApiClient.getAuthentication<OAuth>('oauth_2_0').accessToken = 'YOUR_ACCESS_TOKEN';
final api = SpotifyOpenapi().getPlaylistsApi();
final String playlistId = 3cEYpjA9oz9GiPac4AsH4n; // String |
final int position = 0; // int |
final String uris = spotify:track:4iV5W9uYEdYUVa79Axb7Rh,spotify:track:1301WleyT98MSxVHPZCA6M; // String |
final BuiltMap<String, JsonObject> requestBody = ; // BuiltMap<String, JsonObject> |
try {
final response = api.addTracksToPlaylist(playlistId, position, uris, requestBody);
print(response);
} catch on DioException (e) {
print('Exception when calling PlaylistsApi->addTracksToPlaylist: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
playlistId | String | ||
position | int | [optional] | |
uris | String | [optional] | |
requestBody | BuiltMap<String, JsonObject> | [optional] |
ReorderOrReplacePlaylistsTracks200Response
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
changePlaylistDetails(playlistId, requestBody)
Change Playlist Details
Change a playlist's name and public/private state. (The user must, of course, own the playlist.)
import 'package:spotify_openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: oauth_2_0
//defaultApiClient.getAuthentication<OAuth>('oauth_2_0').accessToken = 'YOUR_ACCESS_TOKEN';
final api = SpotifyOpenapi().getPlaylistsApi();
final String playlistId = 3cEYpjA9oz9GiPac4AsH4n; // String |
final BuiltMap<String, JsonObject> requestBody = ; // BuiltMap<String, JsonObject> |
try {
api.changePlaylistDetails(playlistId, requestBody);
} catch on DioException (e) {
print('Exception when calling PlaylistsApi->changePlaylistDetails: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
playlistId | String | ||
requestBody | BuiltMap<String, JsonObject> | [optional] |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
BuiltList checkIfUserFollowsPlaylist(playlistId, ids)
Check if Users Follow Playlist
Check to see if one or more Spotify users are following a specified playlist.
import 'package:spotify_openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: oauth_2_0
//defaultApiClient.getAuthentication<OAuth>('oauth_2_0').accessToken = 'YOUR_ACCESS_TOKEN';
final api = SpotifyOpenapi().getPlaylistsApi();
final String playlistId = 3cEYpjA9oz9GiPac4AsH4n; // String |
final String ids = jmperezperez,thelinmichael,wizzler; // String |
try {
final response = api.checkIfUserFollowsPlaylist(playlistId, ids);
print(response);
} catch on DioException (e) {
print('Exception when calling PlaylistsApi->checkIfUserFollowsPlaylist: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
playlistId | String | ||
ids | String |
BuiltList<bool>
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PlaylistObject createPlaylist(userId, requestBody)
Create Playlist
Create a playlist for a Spotify user. (The playlist will be empty until you add tracks.)
import 'package:spotify_openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: oauth_2_0
//defaultApiClient.getAuthentication<OAuth>('oauth_2_0').accessToken = 'YOUR_ACCESS_TOKEN';
final api = SpotifyOpenapi().getPlaylistsApi();
final String userId = smedjan; // String |
final BuiltMap<String, JsonObject> requestBody = ; // BuiltMap<String, JsonObject> |
try {
final response = api.createPlaylist(userId, requestBody);
print(response);
} catch on DioException (e) {
print('Exception when calling PlaylistsApi->createPlaylist: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
userId | String | ||
requestBody | BuiltMap<String, JsonObject> | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
followPlaylist(playlistId, requestBody)
Follow Playlist
Add the current user as a follower of a playlist.
import 'package:spotify_openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: oauth_2_0
//defaultApiClient.getAuthentication<OAuth>('oauth_2_0').accessToken = 'YOUR_ACCESS_TOKEN';
final api = SpotifyOpenapi().getPlaylistsApi();
final String playlistId = 3cEYpjA9oz9GiPac4AsH4n; // String |
final BuiltMap<String, JsonObject> requestBody = ; // BuiltMap<String, JsonObject> |
try {
api.followPlaylist(playlistId, requestBody);
} catch on DioException (e) {
print('Exception when calling PlaylistsApi->followPlaylist: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
playlistId | String | ||
requestBody | BuiltMap<String, JsonObject> | [optional] |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PagingFeaturedPlaylistObject getACategoriesPlaylists(categoryId, country, limit, offset)
Get Category's Playlists
Get a list of Spotify playlists tagged with a particular category.
import 'package:spotify_openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: oauth_2_0
//defaultApiClient.getAuthentication<OAuth>('oauth_2_0').accessToken = 'YOUR_ACCESS_TOKEN';
final api = SpotifyOpenapi().getPlaylistsApi();
final String categoryId = dinner; // String |
final String country = SE; // String |
final int limit = 10; // int |
final int offset = 5; // int |
try {
final response = api.getACategoriesPlaylists(categoryId, country, limit, offset);
print(response);
} catch on DioException (e) {
print('Exception when calling PlaylistsApi->getACategoriesPlaylists: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
categoryId | String | ||
country | String | [optional] | |
limit | int | [optional] [default to 20] | |
offset | int | [optional] [default to 0] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PagingPlaylistObject getAListOfCurrentUsersPlaylists(limit, offset)
Get Current User's Playlists
Get a list of the playlists owned or followed by the current Spotify user.
import 'package:spotify_openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: oauth_2_0
//defaultApiClient.getAuthentication<OAuth>('oauth_2_0').accessToken = 'YOUR_ACCESS_TOKEN';
final api = SpotifyOpenapi().getPlaylistsApi();
final int limit = 10; // int |
final int offset = 5; // int |
try {
final response = api.getAListOfCurrentUsersPlaylists(limit, offset);
print(response);
} catch on DioException (e) {
print('Exception when calling PlaylistsApi->getAListOfCurrentUsersPlaylists: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
limit | int | [optional] [default to 20] | |
offset | int | [optional] [default to 0] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PagingFeaturedPlaylistObject getFeaturedPlaylists(country, locale, timestamp, limit, offset)
Get Featured Playlists
Get a list of Spotify featured playlists (shown, for example, on a Spotify player's 'Browse' tab).
import 'package:spotify_openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: oauth_2_0
//defaultApiClient.getAuthentication<OAuth>('oauth_2_0').accessToken = 'YOUR_ACCESS_TOKEN';
final api = SpotifyOpenapi().getPlaylistsApi();
final String country = SE; // String |
final String locale = sv_SE; // String |
final String timestamp = 2014-10-23T09:00:00; // String |
final int limit = 10; // int |
final int offset = 5; // int |
try {
final response = api.getFeaturedPlaylists(country, locale, timestamp, limit, offset);
print(response);
} catch on DioException (e) {
print('Exception when calling PlaylistsApi->getFeaturedPlaylists: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
country | String | [optional] | |
locale | String | [optional] | |
timestamp | String | [optional] | |
limit | int | [optional] [default to 20] | |
offset | int | [optional] [default to 0] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PagingPlaylistObject getListUsersPlaylists(userId, limit, offset)
Get User's Playlists
Get a list of the playlists owned or followed by a Spotify user.
import 'package:spotify_openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: oauth_2_0
//defaultApiClient.getAuthentication<OAuth>('oauth_2_0').accessToken = 'YOUR_ACCESS_TOKEN';
final api = SpotifyOpenapi().getPlaylistsApi();
final String userId = smedjan; // String |
final int limit = 10; // int |
final int offset = 5; // int |
try {
final response = api.getListUsersPlaylists(userId, limit, offset);
print(response);
} catch on DioException (e) {
print('Exception when calling PlaylistsApi->getListUsersPlaylists: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
userId | String | ||
limit | int | [optional] [default to 20] | |
offset | int | [optional] [default to 0] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PlaylistObject getPlaylist(playlistId, market, fields, additionalTypes)
Get Playlist
Get a playlist owned by a Spotify user.
import 'package:spotify_openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: oauth_2_0
//defaultApiClient.getAuthentication<OAuth>('oauth_2_0').accessToken = 'YOUR_ACCESS_TOKEN';
final api = SpotifyOpenapi().getPlaylistsApi();
final String playlistId = 3cEYpjA9oz9GiPac4AsH4n; // String |
final String market = ES; // String |
final String fields = items(added_by.id,track(name,href,album(name,href))); // String |
final String additionalTypes = additionalTypes_example; // String |
try {
final response = api.getPlaylist(playlistId, market, fields, additionalTypes);
print(response);
} catch on DioException (e) {
print('Exception when calling PlaylistsApi->getPlaylist: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
playlistId | String | ||
market | String | [optional] | |
fields | String | [optional] | |
additionalTypes | String | [optional] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
BuiltList getPlaylistCover(playlistId)
Get Playlist Cover Image
Get the current image associated with a specific playlist.
import 'package:spotify_openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: oauth_2_0
//defaultApiClient.getAuthentication<OAuth>('oauth_2_0').accessToken = 'YOUR_ACCESS_TOKEN';
final api = SpotifyOpenapi().getPlaylistsApi();
final String playlistId = 3cEYpjA9oz9GiPac4AsH4n; // String |
try {
final response = api.getPlaylistCover(playlistId);
print(response);
} catch on DioException (e) {
print('Exception when calling PlaylistsApi->getPlaylistCover: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
playlistId | String |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PagingPlaylistTrackObject getPlaylistsTracks(playlistId, market, fields, limit, offset, additionalTypes)
Get Playlist Items
Get full details of the items of a playlist owned by a Spotify user.
import 'package:spotify_openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: oauth_2_0
//defaultApiClient.getAuthentication<OAuth>('oauth_2_0').accessToken = 'YOUR_ACCESS_TOKEN';
final api = SpotifyOpenapi().getPlaylistsApi();
final String playlistId = 3cEYpjA9oz9GiPac4AsH4n; // String |
final String market = ES; // String |
final String fields = items(added_by.id,track(name,href,album(name,href))); // String |
final int limit = 10; // int |
final int offset = 5; // int |
final String additionalTypes = additionalTypes_example; // String |
try {
final response = api.getPlaylistsTracks(playlistId, market, fields, limit, offset, additionalTypes);
print(response);
} catch on DioException (e) {
print('Exception when calling PlaylistsApi->getPlaylistsTracks: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
playlistId | String | ||
market | String | [optional] | |
fields | String | [optional] | |
limit | int | [optional] [default to 20] | |
offset | int | [optional] [default to 0] | |
additionalTypes | String | [optional] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ReorderOrReplacePlaylistsTracks200Response removeTracksPlaylist(playlistId, removeTracksPlaylistRequest)
Remove Playlist Items
Remove one or more items from a user's playlist.
import 'package:spotify_openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: oauth_2_0
//defaultApiClient.getAuthentication<OAuth>('oauth_2_0').accessToken = 'YOUR_ACCESS_TOKEN';
final api = SpotifyOpenapi().getPlaylistsApi();
final String playlistId = 3cEYpjA9oz9GiPac4AsH4n; // String |
final RemoveTracksPlaylistRequest removeTracksPlaylistRequest = ; // RemoveTracksPlaylistRequest |
try {
final response = api.removeTracksPlaylist(playlistId, removeTracksPlaylistRequest);
print(response);
} catch on DioException (e) {
print('Exception when calling PlaylistsApi->removeTracksPlaylist: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
playlistId | String | ||
removeTracksPlaylistRequest | RemoveTracksPlaylistRequest | [optional] |
ReorderOrReplacePlaylistsTracks200Response
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ReorderOrReplacePlaylistsTracks200Response reorderOrReplacePlaylistsTracks(playlistId, uris, requestBody)
Update Playlist Items
Either reorder or replace items in a playlist depending on the request's parameters. To reorder items, include range_start
, insert_before
, range_length
and snapshot_id
in the request's body. To replace items, include uris
as either a query parameter or in the request's body. Replacing items in a playlist will overwrite its existing items. This operation can be used for replacing or clearing items in a playlist.
Note: Replace and reorder are mutually exclusive operations which share the same endpoint, but have different parameters. These operations can't be applied together in a single request.
import 'package:spotify_openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: oauth_2_0
//defaultApiClient.getAuthentication<OAuth>('oauth_2_0').accessToken = 'YOUR_ACCESS_TOKEN';
final api = SpotifyOpenapi().getPlaylistsApi();
final String playlistId = 3cEYpjA9oz9GiPac4AsH4n; // String |
final String uris = uris_example; // String |
final BuiltMap<String, JsonObject> requestBody = ; // BuiltMap<String, JsonObject> |
try {
final response = api.reorderOrReplacePlaylistsTracks(playlistId, uris, requestBody);
print(response);
} catch on DioException (e) {
print('Exception when calling PlaylistsApi->reorderOrReplacePlaylistsTracks: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
playlistId | String | ||
uris | String | [optional] | |
requestBody | BuiltMap<String, JsonObject> | [optional] |
ReorderOrReplacePlaylistsTracks200Response
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
unfollowPlaylist(playlistId)
Unfollow Playlist
Remove the current user as a follower of a playlist.
import 'package:spotify_openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: oauth_2_0
//defaultApiClient.getAuthentication<OAuth>('oauth_2_0').accessToken = 'YOUR_ACCESS_TOKEN';
final api = SpotifyOpenapi().getPlaylistsApi();
final String playlistId = 3cEYpjA9oz9GiPac4AsH4n; // String |
try {
api.unfollowPlaylist(playlistId);
} catch on DioException (e) {
print('Exception when calling PlaylistsApi->unfollowPlaylist: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
playlistId | String |
void (empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
uploadCustomPlaylistCover(playlistId, body)
Add Custom Playlist Cover Image
Replace the image used to represent a specific playlist.
import 'package:spotify_openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: oauth_2_0
//defaultApiClient.getAuthentication<OAuth>('oauth_2_0').accessToken = 'YOUR_ACCESS_TOKEN';
final api = SpotifyOpenapi().getPlaylistsApi();
final String playlistId = 3cEYpjA9oz9GiPac4AsH4n; // String |
final String body = BYTE_ARRAY_DATA_HERE; // String |
try {
api.uploadCustomPlaylistCover(playlistId, body);
} catch on DioException (e) {
print('Exception when calling PlaylistsApi->uploadCustomPlaylistCover: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
playlistId | String | ||
body | String | [optional] |
void (empty response body)
- Content-Type: image/jpeg
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]