MyspaceToolkit

After spending the last 10 days working off and on against the Myspace Developer Platform (MDP), I have released an initial version of a toolkit (class library) that integrates into the platform. It specifically integrates into the REST API's exposed by myspace. Eventually, I seeing the toolkit evolving with the platform and providing much of the same functionality that the facebook toolkits have provided. As long as there is a similar method by which myspace will allow developers to host pages on an external site and then setup a callback url everything will run well.

Some of the things that I wanted to get done with this library was the basic framework for posting the variables to the MDP API endpoint. It currently has not exposed a highly abstracted layer which would make calls to this request layer. I will be implementing this so that it is quite easy for any developer to access the data needed.

Some of the challenges that I faced while developing this toolkit resided with the authentication method that myspace is using. They are using the OAuth routine which is fairly new to authentication schemes. The general purpose behind it is that you can authenticate users without needing a username or password. You would need to use another piece of data to authenticate them other then a username or password. Then based on a some variables most importantly consumerKey, consumerSecret, Timestamp and then the method to generate a unique signature, you would be able to verify on the serverside that the request is valid based off of this unique hash using (HMAC-SHA1) and converting the result to a Base64 string.

I utilized an existing .NET class library (http://eran.sandler.co.il/ & http://oauth.googlecode.com/svn/code/csharp/OAuthBase.cs) that followed the spec to what I believe is exact. However, the class didn't seem to produce a valid signature and web address according to responses I was getting from the MDP API. You can read about all of my issues here. Needless to say after a few days and many forum posts and plenty of breakpoints I found all of the issues.

It mostly had to do with the way in which the query strings were being URL encoded as well as how the signature was being encoded. Once that was resolved making calls to the Myspace API was a breeze. Now, I'm looking at cleaning up the toolkit to provide that abstract layer in the form of a class called MyspaceClient. This would allow a developer for instance to make a call like:

MyspaceClient mc = new MyspaceClient(String apiKey, String consumerSecret, ... etc);
Datatable dt = mc.GetFriends();

I'm thinking of making it deserialize JSON if that's what is selected to be sent back, otherwise it would be deserializing and serializng of the XML.

Feel free to comment and send me your questions. Additionally, if you would like to join this project just shoot me your contact information to joe [at] joedeveloper [dot] net

Thanks!
Joseph Farrar

kick it on DotNetKicks.com


12 comments

Comments

March 20. 2008 09:22 PM

Hi Joseph,

You have done a great job, i used your library to understand the myspace API. I have one doubt, the APIs uses userid (a numeric value). What if i wish to access photos etc for some other user through some other application, ideally it should allow passing usename (email) and password, but i am not able to find out how to do that or how to get the numeric id using username.

I appreciate if you can help

Thanks

Tarun

May 13. 2008 02:15 PM

Hi,

I have started to use your client library and it's really good. But I would like to know how to ascertain the myspace user id dynamically. i.e. The user ID of the logged in person. Can you please advice on this ..

Thanks,

Paul Williams

Paul Williams

August 22. 2008 12:28 PM

dfsdfsdfsdfsdfsdfsdffdfds

sdfrtreter

September 22. 2008 03:00 PM

Hi,
Even i am having the same issue on how to get the userid... coz along with the access token i don't recieve any information from myspace like the currently logged in user's id or any thing of that sort.. what i believe is that without getting the userid we cannot get the user profile details. http://api.myspace.com/v1/users/{userid}/profile.
so without getting the userid i cannot go forward.. can u suggest anything on this.

Hisham

March 9. 2009 01:08 PM

Hi Joseph, i'm trying to make REST calls and getting "401 invalid digital signature", how did you end up encoding that to fix your issue?

Thanks!

greenerist

About Me

JoeDeveloper is a great group of developers doing some cool stuff.

Call Me Now

Recent comments