|
3 | 3 | # Spotify Web API Wrapper |
4 | 4 | Spotify API wrapper for Java |
5 | 5 |
|
| 6 | +## Guides |
| 7 | +Use the following guides provided by Spotify to use this library: |
| 8 | +- [Authorization Guide](https://developer.spotify.com/documentation/general/guides/authorization-guide/) |
| 9 | +- [Web API](https://developer.spotify.com/documentation/web-api/reference/) |
| 10 | + |
6 | 11 | ## Example usages |
7 | 12 | ### Client Credentials Flow |
8 | 13 | The Client Credentials flow is used in server-to-server authentication. Only endpoints that do not access user information can be accessed. |
@@ -53,7 +58,7 @@ AuthorizationCodeFlowTokenResponse token = authorizationRequestToken |
53 | 58 | "REDIRECT URI"); |
54 | 59 | ``` |
55 | 60 |
|
56 | | -## Authorization Code Flow with Proof Key for Code Exchange (PKCE) |
| 61 | +### Authorization Code Flow with Proof Key for Code Exchange (PKCE) |
57 | 62 | The authorization code flow with PKCE is the best option for mobile and desktop applications where it is unsafe to store your client secret. It provides your app with an access token that can be refreshed. For further information about this flow, see [IETF RFC-7636](https://tools.ietf.org/html/rfc7636). |
58 | 63 |
|
59 | 64 | The first step to get an access and refresh token through the Authorization PKCE Code Flow is to build an url. |
@@ -92,14 +97,14 @@ final String accessToken = a.getAccessAndRefreshToken( |
92 | 97 | "CODE VERIFIER") |
93 | 98 | .getAccessToken(); |
94 | 99 | ``` |
95 | | -## Using access token |
| 100 | +### Using access token |
96 | 101 | The `AuthorizationCodeFlowTokenResponse` contains the access and refresh token. The access and refresh token can be used to access api endpoints. |
97 | 102 | ```java |
98 | 103 | SpotifyApi spotifyApi = new SpotifyApi("ACCESS TOKEN", "REFRESH TOKEN"); |
99 | 104 | AlbumFull albumFull = spotifyApi.getAlbum("ALBUM ID"); |
100 | 105 | ``` |
101 | 106 |
|
102 | | -## Refreshing access token |
| 107 | +### Refreshing access token |
103 | 108 | When the access token has expired it can be refreshed using `AuthorizationRefreshToken` |
104 | 109 | ```java |
105 | 110 | AuthorizationCodeFlowTokenResponse token = authorizationRefreshToken |
|
0 commit comments