

Using the authorization code flow to retrieve an access token is necessary if the requests are bound to a specific user.

Return a refresh token and is useful for simple requests, like fetching albums or searching for tracks.Įxample: ClientCredentialsExample.java Authorization Code Flow Use the client credentials flow when the requests don't require permission from a specific user. There are three ways to retrieving an access token: Client Credentials Flow Those properties will then beĪutomatically used by functions that depend on them. When using the authorization code flow, the application's redirect URI is required too. Your application's client ID and client secret set as its properties. Please see Spotify's Authorization Guide too!įor authorization requests the API object requires at least to have Wait for the request to complete final Something something = somethingFuture. Execute the request asynchronous final Future somethingFuture = getSomethingRequest. Execute the request synchronous final Something something = getSomethingRequest. Create a request object with the optional parameter "market" final GetSomethingRequest getSomethingRequest = spotifyApi. setAccessToken( "taHZ2SdB-bPA3FsK3D7ZN5npZS47cMy-IEySVEGttOhXmqaVAIo0ESvTCLjLBifhHOHOIuhFUKPW1WMDP7w6dj3MAZdWT8CLI2MkZaXbYLTeoDvXesf2eeiLYPBGdx8tIwQJKgV8XdnzH_DONk") For all requests an access token is needed SpotifyApi spotifyApi = new SpotifyApi.
