SpotifyApi

sealed class SpotifyApi<T : SpotifyApi<T, B>, B : ISpotifyApiBuilder<T, B>>

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.

Types

Companion
Link copied to clipboard
common
object Companion

Functions

clearCache
Link copied to clipboard
common
fun clearCache()
If the cache is enabled, clear all stored queries in the cache
equals
Link copied to clipboard
common
open operator fun equals(other: Any?): Boolean
getApiBuilder
Link copied to clipboard
common
abstract fun getApiBuilder(): SpotifyApiBuilder
Return a new SpotifyApiBuilder with the parameters provided to this api instance
getApiBuilderDsl
Link copied to clipboard
common
abstract fun getApiBuilderDsl(): B
Return a new B with the parameters provided to this api instance
getAuthorizationUrl
Link copied to clipboard
common
fun getAuthorizationUrl(vararg scopes: SpotifyScope, redirectUri: String, state: String? = null): String
Create a Spotify authorization URL from which client access can be obtained
getCache
Link copied to clipboard
common
fun getCache(): Map<SpotifyRequest, CacheState>
Obtain a map of all currently-cached requests
getSpotifyPkceAuthorizationUrl
Link copied to clipboard
common
fun getSpotifyPkceAuthorizationUrl(vararg scopes: SpotifyScope, redirectUri: String, codeChallenge: String, state: String? = null): String
hashCode
Link copied to clipboard
common
open fun hashCode(): Int
isTokenValid
Link copied to clipboard
common
suspend fun isTokenValid(makeTestRequest: Boolean = true): TokenValidityResponse
Tests whether the current token is actually valid.
refreshToken
Link copied to clipboard
common
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
toString
Link copied to clipboard
common
open fun toString(): String
updateToken
Link copied to clipboard
common
fun updateToken(modifier: Token.() -> Unit)
Modify the current Token via DSL
updateTokenWith
Link copied to clipboard
common
fun updateTokenWith(tokenString: String)
Change the current Token's access token

Properties

albums
Link copied to clipboard
common
abstract val albums: AlbumApi
Provides access to Spotify album endpoints
artists
Link copied to clipboard
common
abstract val artists: ArtistApi
Provides access to Spotify artist endpoints
browse
Link copied to clipboard
common
abstract val browse: BrowseApi
Provides access to Spotify browse endpoints
clientId
Link copied to clipboard
common
val clientId: String?
The application client id found on the application dashboard
clientSecret
Link copied to clipboard
common
val clientSecret: String?
The application client secret found on the application dashboard
endpoints
Link copied to clipboard
common
abstract val endpoints: List<SpotifyEndpoint>
A list of all endpoints included in this api type
episodes
Link copied to clipboard
common
abstract val episodes: EpisodeApi
Provides access to Spotify episode endpoints
expireTime
Link copied to clipboard
common
val expireTime: Long
following
Link copied to clipboard
common
abstract val following: FollowingApi
playlists
Link copied to clipboard
common
abstract val playlists: PlaylistApi
runExecutableFunctions
Link copied to clipboard
common
var runExecutableFunctions: Boolean = true
search
Link copied to clipboard
common
abstract val search: SearchApi
Provides access to the Spotify search endpoint
shows
Link copied to clipboard
common
abstract val shows: ShowApi
Provides access to Spotify show endpoints
spotifyApiOptions
Link copied to clipboard
common
var spotifyApiOptions: SpotifyApiOptions
Configurable Spotify API options.
token
Link copied to clipboard
common
var token: Token
The access token associated with this API instance
tracks
Link copied to clipboard
common
abstract val tracks: TrackApi
Provides access to Spotify track endpoints
useCache
Link copied to clipboard
common
var useCache: Boolean
users
Link copied to clipboard
common
abstract val users: UserApi

Inheritors

SpotifyAppApi
Link copied to clipboard
SpotifyClientApi
Link copied to clipboard

Sources

(source)
Link copied to clipboard