SpotifyApiBuilder

class SpotifyApiBuilder(clientId: String?, clientSecret: String?, redirectUri: String?)(source)

Spotify API builder

Constructors

Link copied to clipboard
constructor(clientId: String?, clientSecret: String?, redirectUri: String?)

Properties

Link copied to clipboard

Allows you to authenticate a SpotifyClientApi with an authorization code or build SpotifyApi using a refresh token

Link copied to clipboard

Allows you to override default values for caching, token refresh, and logging

Functions

Link copied to clipboard

Set whether you want to allow splitting too-large requests into smaller, allowable api requests

Link copied to clipboard
fun authorizationCode(authorizationCode: String?): SpotifyApiBuilder

Set a returned authorization code

Link copied to clipboard

Enable or disable automatic refresh of the Spotify access token

Link copied to clipboard

Create a SpotifyApi instance with the given SpotifyApiBuilder parameters and the type - AuthorizationType.Client for client authentication, or otherwise AuthorizationType.Application

Link copied to clipboard

Create a new SpotifyClientApi that has access to public endpoints, in addition to endpoints requiring scopes contained in the client authorization request

Link copied to clipboard

Create a new SpotifyClientApi that has access to public endpoints, in addition to endpoints requiring scopes contained in the client authorization request

Link copied to clipboard

Create a new SpotifyAppApi that only has access to public endpoints and data

Link copied to clipboard

Create a new SpotifyAppApi that only has access to public endpoints and data

Link copied to clipboard
suspend fun buildPublic(): SpotifyAppApi

Create a new SpotifyAppApi that only has access to public endpoints and data

Link copied to clipboard

Create a new SpotifyAppApi that only has access to public endpoints and data

Link copied to clipboard

Create a SpotifyApi instance with the given SpotifyApiBuilder parameters and the type - AuthorizationType.Client for client authentication, or otherwise AuthorizationType.Application

Link copied to clipboard
fun cacheLimit(cacheLimit: Int?): SpotifyApiBuilder

Set the maximum allowed amount of cached requests at one time. Null means no limit

Link copied to clipboard

Set the application client id

Link copied to clipboard

Set the application client secret

Link copied to clipboard
fun defaultLimit(defaultLimit: Int): SpotifyApiBuilder

Allows you to set the default amount of objects to retrieve in one request

Link copied to clipboard

Set the application redirect uri

Link copied to clipboard
fun requestTimeoutMillis(requestTimeoutMillis: Long?): SpotifyApiBuilder

Set the maximum time, in milliseconds, before terminating an http request

Link copied to clipboard
fun retryWhenRateLimited(retryWhenRateLimited: Boolean): SpotifyApiBuilder

Set whether to block the current thread and wait until the API can retry the request

Link copied to clipboard

After API creation, set whether to test whether the token is valid by performing a lightweight request

Link copied to clipboard

Set the token to be used with this api instance

Link copied to clipboard

If you only have an access token, the api can be instantiated with it

Link copied to clipboard

Set whether to cache requests. Default: true