Class TokenExchangeResponse

java.lang.Object
com.spotify.sdk.android.auth.TokenExchangeResponse

public class TokenExchangeResponse extends Object
Response from a token exchange request. Contains either the access token information or error details.
  • Method Details

    • isSuccess

      public boolean isSuccess()
      Returns:
      true if the token exchange was successful, false otherwise
    • getAccessToken

      @Nullable public String getAccessToken()
      Returns:
      the access token if successful, null otherwise
    • getTokenType

      @Nullable public String getTokenType()
      Returns:
      the token type (usually "Bearer") if successful, null otherwise
    • getExpiresIn

      public int getExpiresIn()
      Returns:
      the number of seconds the access token is valid for, 0 if not provided or on error
    • getScope

      @Nullable public String getScope()
      Returns:
      the scope of the access token if provided, null otherwise
    • getRefreshToken

      @Nullable public String getRefreshToken()
      Returns:
      the refresh token if provided, null otherwise
    • getError

      @Nullable public String getError()
      Returns:
      the error code if the request failed, null if successful
    • getErrorDescription

      @Nullable public String getErrorDescription()
      Returns:
      the error description if the request failed, null if successful