Question

Ok this is really frustrating. I'm using my API key perfectly fine. Authentication does just fine, token is generated fine, session key is also OK.

But when I run the playlist.create, the playlist is not created.

Addendum (6 April 2013): It turned out I had to generate a new md5 hash for my sig, but even after doing so, the method does not work.

Addendum 2 (9 April 2013): I started from almost scratch today, and redid most of my code. I created 16 playlists successfully, no errors. But today, the same code's not working. I didn't touch it at all and yet the error.

nvm


For security purposes, I cannot show you my security keys. However, I did write a quick program to find the last.fm session key: http://github.com/thekarangoel/LastFMSessionKeyFinder Simply register at last.fm/api, enter your API key and secret in the program and you'll have everything you need to test the API call.

Was it helpful?

Solution

My gazillionth answer

You did not include the description in your hashed signature.

My second answer

As mentioned before in one of my comments, you're code is causing a MalformedURLException. You don't see this because you're doing no exception handling within your SwingWorker subclass. If you add exception handling as suggested here, you'll see that.

My first answer

You're missing an & in your parameter list:

String params = "method=playlist.create&title=" + title+ "api_key=" + ...

Should be

String params = "method=playlist.create&title=" + title+ "&api_key=" + ...

It's probably a good idea to read the answer of the request (connection.getInputStream() etc.) and check what the issue is.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top