SpotifyApi

Represents an instance of the Spotify API client, with common functionality and information between the SpotifyClientApi and SpotifyAppApi implementations of the API

Parameters

clientId

The application client id found on the application dashboard

clientSecret

The application client secret found on the application dashboard

token

The access token associated with this API instance

spotifyApiOptions

Configurable Spotify API options.

Inheritors

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val albums: AlbumApi

Provides access to Spotify album endpoints

Link copied to clipboard
abstract val artists: ArtistApi

Provides access to Spotify artist endpoints

Link copied to clipboard
abstract val browse: BrowseApi

Provides access to Spotify browse endpoints

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

A list of all endpoints included in this api type

Link copied to clipboard
abstract val episodes: EpisodeApi

Provides access to Spotify episode endpoints

Link copied to clipboard
Link copied to clipboard
abstract val following: FollowingApi
Link copied to clipboard
abstract val markets: MarketsApi

Provides access to Spotify market endpoints

Link copied to clipboard
abstract val playlists: PlaylistApi
Link copied to clipboard
Link copied to clipboard
abstract val search: SearchApi

Provides access to the Spotify search endpoint

Link copied to clipboard
abstract val shows: ShowApi

Provides access to Spotify show endpoints

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract val tracks: TrackApi

Provides access to Spotify track endpoints

Link copied to clipboard
Link copied to clipboard
abstract val users: UserApi

Functions

Link copied to clipboard

If the cache is enabled, clear all stored queries in the cache

Link copied to clipboard

Return a new SpotifyApiBuilder with the parameters provided to this api instance

Link copied to clipboard
abstract fun getApiBuilderDsl(): B

Return a new B with the parameters provided to this api instance

Link copied to clipboard
fun getAuthorizationUrl(vararg scopes: SpotifyScope, redirectUri: String, state: String? = null): String

Create a Spotify authorization URL from which client access can be obtained

Link copied to clipboard

Obtain a map of all currently-cached requests

Link copied to clipboard
fun getSpotifyPkceAuthorizationUrl(vararg scopes: SpotifyScope, redirectUri: String, codeChallenge: String, state: String? = null): String
Link copied to clipboard
suspend fun isTokenValid(makeTestRequest: Boolean = true): TokenValidityResponse

Tests whether the current token is actually valid. By default, an endpoint is called once to verify validity.

Link copied to clipboard

Tests whether the current token is actually valid. By default, an endpoint is called once to verify validity.

Link copied to clipboard
suspend fun refreshToken(): Token

If the method used to create the token supports token refresh and the information in token is accurate, attempt to refresh the token

Link copied to clipboard

If the method used to create the token supports token refresh and the information in token is accurate, attempt to refresh the token

Link copied to clipboard
fun updateToken(modifier: Token.() -> Unit)

Modify the current Token via DSL

Link copied to clipboard
fun updateTokenWith(tokenString: String)

Change the current Token's access token