-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAccessTokenExample.java
More file actions
30 lines (22 loc) · 947 Bytes
/
AccessTokenExample.java
File metadata and controls
30 lines (22 loc) · 947 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package authorization;
import dev.spoocy.genius.GeniusClient;
import dev.spoocy.genius.core.TextFormat;
/**
* @author Spoocy99 | GitHub: Spoocy99
*/
public class AccessTokenExample {
public static void main(String[] args) {
GeniusClient client = GeniusClient.builder()
.clientId("your_client_id")
.clientSecret("your_client_secret")
.accessToken("your_access_token") // You can get a client access token by clicking "Generate Access Token" on the API Client management page
.build();
// start making requests
client.getArtist(16775L, TextFormat.PLAIN)
.subscribe(artist -> {
System.out.printf("Artist Name: %s%n", artist.getName());
System.out.printf("Artist ID: %d%n", artist.getId());
System.out.printf("Artist URL: %s%n", artist.getUrl());
});
}
}