requestAuthorizationCodeWithPkceToken

suspend fun requestAuthorizationCodeWithPkceToken(clientId: String, code: String, redirectUri: String, codeVerifier: String): SpotifyApiResponse<TokenResponse>

Exchanges an authorization code for access and refresh tokens using PKCE.

Return

Wrapped Spotify API response with status code and parsed Spotify payload.

Parameters

clientId

Spotify application Client ID.

code

Authorization code issued by Spotify Accounts service.

redirectUri

Redirect URI registered in Spotify Dashboard.

codeVerifier

PKCE code verifier used when exchanging authorization code.