requestAuthorizationCodeToken

suspend fun requestAuthorizationCodeToken(clientId: String, clientSecret: String, code: String, redirectUri: String): SpotifyApiResponse<TokenResponse>

Exchanges an authorization code for access and refresh tokens.

Return

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

Parameters

clientId

Spotify application Client ID.

clientSecret

Spotify application Client Secret.

code

Authorization code issued by Spotify Accounts service.

redirectUri

Redirect URI registered in Spotify Dashboard.