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

component1
Link copied to clipboard
common
operator fun component1(): String
component2
Link copied to clipboard
common
operator fun component2(): String
component3
Link copied to clipboard
common
operator fun component3(): Int
component4
Link copied to clipboard
common
operator fun component4(): String?
copy
Link copied to clipboard
common
fun copy(accessToken: String, tokenType: String, expiresIn: Int, refreshToken: String? = null, scopeString: String? = null): Token
equals
Link copied to clipboard
common
open operator override fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
common
open override fun hashCode(): Int
shouldRefresh
Link copied to clipboard
common
fun shouldRefresh(): Boolean
toString
Link copied to clipboard
common
open override fun toString(): String

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

(source)
Link copied to clipboard