Token

data class Token(accessToken: String, tokenType: String, expiresIn: Int, refreshToken: String?, scopeString: String?)

Represents a Spotify Token, retrieved through instantiating a SpotifyApi

Parameters

accessToken

An access token that can be provided in subsequent calls, for example to Spotify Web API services.

tokenType

How the access token may be used: always Bearer”.

expiresIn

The time period (in seconds) for which the access token is valid.

refreshToken

A token that can be sent to the Spotify Accounts service in place of an authorization code, null if the token was created using a method that does not support token refresh

Constructors

Token
Link copied to clipboard
common
fun Token(accessToken: String, tokenType: String, expiresIn: Int, refreshToken: String? = null, scopeString: String? = null)
An access token that can be provided in subsequent calls, for example to Spotify Web API services.

Types

Companion
Link copied to clipboard
common
object Companion

Functions

shouldRefresh
Link copied to clipboard
common
fun shouldRefresh(): Boolean

Properties

accessToken
Link copied to clipboard
common
var accessToken: String
An access token that can be provided in subsequent calls, for example to Spotify Web API services.
expiresAt
Link copied to clipboard
common
val expiresAt: Long
The time, in milliseconds, at which this Token expires
expiresIn
Link copied to clipboard
common
var expiresIn: Int
The time period (in seconds) for which the access token is valid.
refreshToken
Link copied to clipboard
common
var refreshToken: String? = null
A token that can be sent to the Spotify Accounts service in place of an authorization code, null if the token was created using a method that does not support token refresh
scopes
Link copied to clipboard
common
val scopes: List<SpotifyScope>?
A list of scopes granted access for this accessToken.
tokenType
Link copied to clipboard
common
val tokenType: String
How the access token may be used: always Bearer”.

Sources

common source
Link copied to clipboard