SpotifyImplicitGrantApi

class SpotifyImplicitGrantApi(clientId: String?, token: Token, spotifyApiOptions: SpotifyApiOptions) : SpotifyClientApi

An API instance created through implicit grant flow, with access to private information managed through the scopes exposed in token. token is not refreshable and is only accessible for limited time.

Constructors

SpotifyImplicitGrantApi
Link copied to clipboard
common
fun SpotifyImplicitGrantApi(clientId: String?, token: Token, spotifyApiOptions: SpotifyApiOptions)

Functions

clearCache
Link copied to clipboard
common
fun clearCache()
If the cache is enabled, clear all stored queries in the cache
getApiBuilder
Link copied to clipboard
common
open override fun getApiBuilder(): SpotifyApiBuilder
Return a new SpotifyApiBuilder with the parameters provided to this api instance
getApiBuilderDsl
Link copied to clipboard
common
open override fun getApiBuilderDsl(): SpotifyClientApiBuilder
Return a new B with the parameters provided to this api instance
getAuthorizationUrl
Link copied to clipboard
common
fun getAuthorizationUrl(vararg scopes: SpotifyScope, state: String? = null): String
Create a Spotify authorization URL from which client access can be obtained
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
getUserId
Link copied to clipboard
common
suspend fun getUserId(): String
The Spotify user id to which the api instance is connected
getUserIdRestAction
Link copied to clipboard
common
fun getUserIdRestAction(): SpotifyRestAction<String>
The Spotify user id to which the api instance is connected
hasScope
Link copied to clipboard
common
suspend fun hasScope(scope: SpotifyScope): Boolean?
Whether the current access token allows access to scope scope
hasScopeRestAction
Link copied to clipboard
common
fun hasScopeRestAction(scope: SpotifyScope): SpotifyRestAction<Boolean?>
Whether the current access token allows access to scope scope
hasScopes
Link copied to clipboard
common
suspend fun hasScopes(scope: SpotifyScope, vararg scopes: SpotifyScope): Boolean?
Whether the current access token allows access to all of the provided scopes
hasScopesRestAction
Link copied to clipboard
common
fun hasScopesRestAction(scope: SpotifyScope, vararg scopes: SpotifyScope): SpotifyRestAction<Boolean?>
Whether the current access token allows access to all of the provided scopes
isTokenValid
Link copied to clipboard
common
suspend fun isTokenValid(makeTestRequest: Boolean = true): TokenValidityResponse
Tests whether the current token is actually valid.
isTokenValidRestAction
Link copied to clipboard
common
fun isTokenValidRestAction(makeTestRequest: Boolean = true): SpotifyRestAction<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
refreshTokenRestAction
Link copied to clipboard
common
fun refreshTokenRestAction(): SpotifyRestAction<Token>
If the method used to create the token supports token refresh and the information in token is accurate, attempt to refresh the token
shutdown
Link copied to clipboard
common
fun shutdown()
Stop all automatic functions like refreshToken or clearCache and shut down the scheduled executor
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
open override val albums: AlbumApi
Provides access to Spotify album endpoints
artists
Link copied to clipboard
common
open override val artists: ArtistApi
Provides access to Spotify artist endpoints
browse
Link copied to clipboard
common
open override 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
open override val endpoints: List<SpotifyEndpoint>
A list of all endpoints included in this api type
episodes
Link copied to clipboard
common
open override val episodes: ClientEpisodeApi
Provides access to Spotify episode endpoints
expireTime
Link copied to clipboard
common
val expireTime: Long
following
Link copied to clipboard
common
open override val following: ClientFollowingApi
Provides access to endpoints for managing the artists, users, and playlists that a Spotify user follows.
library
Link copied to clipboard
common
val library: ClientLibraryApi
Provides access to endpoints for retrieving information about, and managing, tracks that the current user has saved in their “Your Music” library.
markets
Link copied to clipboard
common
open override val markets: MarketsApi
Provides access to Spotify market endpoints
personalization
Link copied to clipboard
common
val personalization: ClientPersonalizationApi
Provides access to endpoints for retrieving information about the user’s listening habits.
player
Link copied to clipboard
common
val player: ClientPlayerApi
Provides access to the betaplayer api, including track playing and pausing endpoints.
playlists
Link copied to clipboard
common
open override val playlists: ClientPlaylistApi
Provides access to endpoints for retrieving information about a user’s playlists and for managing a user’s playlists.
redirectUri
Link copied to clipboard
common
var redirectUri: String?
runExecutableFunctions
Link copied to clipboard
common
var runExecutableFunctions: Boolean
search
Link copied to clipboard
common
open override val search: SearchApi
Provides access to the Spotify search endpoint
shows
Link copied to clipboard
common
open override val shows: ClientShowApi
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
open override val tracks: TrackApi
Provides access to Spotify track endpoints
useCache
Link copied to clipboard
common
var useCache: Boolean
users
Link copied to clipboard
common
open override val users: ClientProfileApi
Provides access to endpoints for retrieving information about a user’s profile.
usesPkceAuth
Link copied to clipboard
common
val usesPkceAuth: Boolean

Sources

common source
Link copied to clipboard