MySpace Open Platform

A Place For Developers

Welcome Developers!

in

Welcome!

in

.NET Client Libraries for REST?

Last post 09-22-2009 8:12 AM by John. 59 replies.
Page 3 of 4 (60 items) < Previous 1 2 3 4 Next >
Sort Posts: Previous Next
  • 03-05-2008 10:29 PM In reply to

    Re: .NET Client Libraries for REST?

    Thanks Peter that class file looked great. I ran some tests against it and it came back really well. I've included it into the project and started abstracting the MyspaceClient class. It currently now has the GetUserProfile method which utilizes the MySpaceProfile object in your class.

    I've checked the files into the system and once more gets done to implement more of the methods I think the next release will be due.

    Thanks for your help and input. I've added you on as a developer/contributer to the project on codeplex.

    Thanks!
    Joseph

  • 03-05-2008 10:32 PM In reply to

    Re: .NET Client Libraries for REST?

    I have no error checking in my method either. There will be some before the next release. I'm just waiting to see if there is going to be a good list of what the error messages really mean. 401 seems to be the most common, and yet it has numerous responses.

    Thanks!
    Joseph

  • 03-10-2008 9:27 AM In reply to

    Re: .NET Client Libraries for REST?

     Hi Joseph.. I was wodering if I could use the.NET library to validate a makeRequest call.. so if the oauth_signature sent with that makeRequest matches the signature I create using this library match.. call gets validated..

    Do you think this is will work?.. 

  • 03-10-2008 12:58 PM In reply to

    Re: .NET Client Libraries for REST?

    I haven't tested it, but it should work as expected. You would just need to work directly with the OAuth.cs file that is included in the myspacetoolkit on codeplex.

    In a later implementation (hopefully soon) I will enable the ability to create a page that inherits a base class from the toolkit that handles this specifically.

    I'm really actually waiting for MDP to implement the fix that they have so that the oauth_signature parameter is passed on these requests. While you could just utilize the information currently, I want to make sure it's secure.

    Thanks!
    Joseph Farrar

  • 03-25-2008 7:53 PM In reply to

    • Peter
    • Not Ranked
    • Joined on 03-22-2008
    • Posts 2

    Re: .NET Client Libraries for REST?

     

  • 03-26-2008 12:15 AM In reply to

    • Peter
    • Not Ranked
    • Joined on 03-22-2008
    • Posts 2

    Re: .NET Client Libraries for REST?

     

  • 04-02-2008 4:26 AM In reply to

    • Elmar
    • Top 150 Contributor
    • Joined on 03-15-2008
    • Posts 31

    Re: .NET Client Libraries for REST?

    I extended the toolkit to implement a JSON serializer/deserializer und wrapper objects for each MySpace Entity (Profile, Status etc.). The only change I had to make in the existing code was to enable URLencode for  

    hmacsha1.Key = Encoding.UTF8.GetBytes(UrlEncode(consumerSecret) + "&"); 

    ...because Authentication would otherwise fail. My extension enables you to do something like:

            public Entities.UserProfile GetUserProfile(string userID)
            {
                string response = CallServiceJSON(HttpPostUtility.RequestMethod.GetProfile, userID);
                var profile = JSON.Deserialize<Entities.UserProfile>(response);
                return (Entities.UserProfile)profile;
            }

    Can it get any easier Wink? I now need a place to upload that package.

  • 04-11-2008 11:48 AM In reply to

    • Peter
    • Top 500 Contributor
    • Joined on 02-06-2008
    • Posts 12

    Re: .NET Client Libraries for REST?

     Which error were yu seeing that required the UrlEncode change? I have not touched my app in a week or so and the server is now returning only 401. Did I miss a breaking change on MySpace?

  • 04-11-2008 1:19 PM In reply to

    Re: .NET Client Libraries for REST?

    Short answer - yes. Last week they changed access to the RESTful API servers -- just change the base url in the Library from 'api.msappspace.com' to 'api.myspace.com'.

  • 05-09-2008 5:08 PM In reply to

    • victor
    • Not Ranked
    • Joined on 05-09-2008
    • Posts 2

    Re: .NET Client Libraries for REST?

    this is pretty cool guys.  I'm a mid-level asp.net / sql developer.  I've been looking for something like this for a while.

    Any suggestions / advice  that you might have.

     Victor

  • 05-09-2008 5:38 PM In reply to

    • victor
    • Not Ranked
    • Joined on 05-09-2008
    • Posts 2

    Re: .NET Client Libraries for REST?

    Joseph I'm getting the following message in the textbox:

     

    The remote server returned an error: (401) Unauthorized.

     

     

    Do I need a specific consumer key / secret ?

     

    Thanks

  • 05-11-2008 12:25 PM In reply to

    • Elmar
    • Top 150 Contributor
    • Joined on 03-15-2008
    • Posts 31

    Re: .NET Client Libraries for REST?

    I remember that I needed to change the lib a little bit to get it working. I think it was this (in OAuth):

    //hmacsha1.Key = Encoding.UTF8.GetBytes(UrlEncode(consumerSecret) + "&");
    hmacsha1.Key = Encoding.UTF8.GetBytes(consumerSecret + "&");

    You might want to give my extended version a try. It generates full net objects from the returned JSON objects.  You can see it working here http://www.myspace.com/aerobis.

    I haven´t et merged it with the existing code. Anyhow you can download the patch from http://www.codeplex.com/myspacetoolkit/SourceControl/PatchList.aspx

    All the best,

    Elmar 

    Filed under:
  • 07-08-2008 6:47 PM In reply to

    • $
    • Top 25 Contributor
    • Joined on 06-28-2008
    • Posts 158

    Re: .NET Client Libraries for REST?

     

    Joseph:

    bump...

    Any feedback everyone?

    Thanks!
    Joseph Farrar

     

    Looks and works great, although I had to take some code out that was appending .xml to the uri.  The sample app also points to an incorrect base uri, it should be api.myspace.com.  Once I made those two changes (after staring at that base uri for hours before I figured out it was incorrect) the sample app worked like a charm.  As an exercise I will do some simple xslt to display profile info on a canvas page.  Thanks for the hard work on this, I certainly wasn't relishing doing it myself!

  • 07-22-2008 5:15 AM In reply to

    Re: .NET Client Libraries for REST?

    401- authorization failed....

     Here are the steps i followed to create an app & run.

     1. Created an app in the myspace

     2. Created a local website in Visual Stuio 2.0

     3. Downloaded the toolkit & added as reference

     4. Updated the source of the applicatoin to inline iframe and given source to my local applicatoin (http://localhot/demo/default.aspx)

     5. Copied the default.aspx from sample (below is the code)

     requestObj.APIversion = "v1";
            requestObj.AssetID = "";
            requestObj.BaseApiUrlHost = "api.msappspace.com";
            requestObj.ConsumerKey = Request.QueryString["oauth_consumer_key"];
            requestObj.ConsumerSecret = "secret key of the app";
            requestObj.RequestMethod = (HttpPostUtility.RequestMethod)Convert.ToInt32(DropDownList1.SelectedItem.Value);
            requestObj.RequestMode = HttpPostUtility.RequestMode.QueryString;
            requestObj.ResponseType = HttpPostUtility.ResponseType.XML;
            requestObj.Token = Request.QueryString["opensocial_token"];
            requestObj.TokenSecret = "";

     6. When i run the applicaion on myspace i am getting the below error

    The remote server returned an error: (401) Unauthorized.

     

     

  • 07-22-2008 7:00 AM In reply to

    • $
    • Top 25 Contributor
    • Joined on 06-28-2008
    • Posts 158

    Re: .NET Client Libraries for REST?

    They changed access to the RESTful API servers. Change the base url in the Library from 'api.msappspace.com' to 'api.myspace.com'.

Page 3 of 4 (60 items) < Previous 1 2 3 4 Next >