spotifyClientApi

fun spotifyClientApi(clientId: String, clientSecret: String, redirectUri: String): SpotifyClientApiBuilder(source)

Instantiate a new SpotifyClientApiBuilder using a Spotify clientId, clientSecret, and redirectUri.

Note: If trying to build SpotifyClientApi, you must provide client authorization in the SpotifyClientApiBuilder.authorization block

Use case: I am using the client authorization flow. I want access to both public and client Spotify API endpoints, and I want to configure authorization and other settings myself.

Return

Configurable SpotifyClientApiBuilder that, when built, creates a new SpotifyClientApi

Parameters

clientId

Spotify client id

clientSecret
redirectUri

Spotify redirect uri


fun spotifyClientApi(clientId: String, clientSecret: String, redirectUri: String, block: SpotifyClientApiBuilder.() -> Unit): SpotifyClientApiBuilder(source)

Instantiate a new SpotifyClientApiBuilder using a Spotify clientId, clientSecret, and redirectUri, with the ability to configure the api settings by providing a builder initialization block

Note: If trying to build SpotifyClientApi, you must provide client authorization in the SpotifyClientApiBuilder.authorization block

Use case: I am using the client authorization flow. I want access to both public and client Spotify API endpoints, and I want to configure authorization and other settings myself.

Return

Configurable SpotifyClientApiBuilder that, when built, creates a new SpotifyClientApi

Parameters

clientId

Spotify client id

clientSecret
redirectUri

Spotify redirect uri

block

Api settings block


fun spotifyClientApi(clientId: String?, clientSecret: String?, redirectUri: String?, authorization: SpotifyUserAuthorization, block: SpotifyApiOptions.() -> Unit = {}): SpotifyClientApiBuilder(source)

Instantiate a new SpotifyClientApiBuilder using a Spotify clientId, clientSecret, and redirectUri, with an existing SpotifyUserAuthorization.

Use case: I am using the client authorization flow. I want access to both public and client Spotify API endpoints and I want to configure authorization and block without using the DSL.

Return

Configurable SpotifyClientApiBuilder that, when built, creates a new SpotifyClientApi

Parameters

clientId

Spotify client id

clientSecret
redirectUri

Spotify redirect uri

authorization

A SpotifyUserAuthorization that must contain one of the following: authorization code (preferred), access token string (tokenString), Token object, and that may contain a refresh token (preferred) with which to refresh the access token

block

Override default API options such as the cache limit


fun spotifyClientApi(clientId: String?, clientSecret: String?, redirectUri: String?, token: Token, block: SpotifyApiOptions.() -> Unit = {}): SpotifyClientApiBuilder(source)

Instantiate a new SpotifyClientApiBuilder using a Spotify clientId, clientSecret, and redirectUri, with an existing SpotifyUserAuthorization.

Use case: I am using the client authorization flow.

Return

Configurable SpotifyClientApiBuilder that, when built, creates a new SpotifyClientApi

Parameters

clientId

Spotify client id

clientSecret
redirectUri

Spotify redirect uri

token

Build the API using an existing token.

block

Override default API options such as the cache limit


Instantiate a new SpotifyClientApiBuilder by providing a builder initialization block

Note: If trying to build SpotifyClientApi, you must provide client authorization in the SpotifyClientApiBuilder.authorization block

Use case: I am using the client authorization flow. I want access to both public and client Spotify API endpoints and I want to handle configuration via the DSL myself.

Return

Configurable SpotifyClientApiBuilder that, when built, creates a new SpotifyClientApi

Parameters

block

Api settings block