0
votes

I want to get the current user's data from spotify.

The documentation says I have to use this command:

curl -X GET "https://api.spotify.com/v1/me" -H "Authorization: Bearer {your access token}"

I successfully get the token string from Spotify. My question is: How should I transform this CURL command to java?

1
I think you simply need to make an HTTP GET or POST request and in response it will return JSON data. - waqaslam

1 Answers

1
votes

You need language bindings and an HTTP client. A lot of this work has been done already in the Android client made by Kaaes.

In your very specific case, you'd use the getMe method as documented here. This returns a UserPrivate object, which contains birthdate, product, email, country, as well as the fields available in the UserPublic object, like display_name.

Full documentation