Skip to content

Commit 0344b4a

Browse files
authored
add(readme): explanation optional parameters
1 parent c23102e commit 0344b4a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,17 @@ AuthorizationCodeFlowTokenResponse token = authorizationRefreshToken.refreshAcce
5555
```
5656
The above code example will return an `AuthorizationCodeFlowTokenResponse` which contains the new access and refresh token.
5757

58+
### Optional parameters
59+
Many API endpoints have optional parameters. Passing in optional parameters are done with a `Map`. If you don't want to pass any optional parameters then just pass in an empty `Map`.
60+
```java
61+
SpotifyApi spotifyApi = new SpotifyApi("ACCESS TOKEN");
62+
63+
Map<String, String> optionalParameters = new HashMap<>();
64+
optionalParameters.put("limit", "10");
65+
66+
CategoryFullPaging categories = spotifyApi.getCategories(optionalParameters);
67+
```
68+
5869
## Error Handling
5970
As of this moment the library can throw three different exceptions.
6071
### HttpRequestFailedException

0 commit comments

Comments
 (0)