MySpace Open Platform

A Place For Developers

Welcome Developers!

in

Welcome!

in

C# Example of API authentication

Last post 03-23-2009 12:53 PM by MR. BOOL - THE SITE FOR SOFTWARE DEVELOPERS. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 02-15-2008 12:03 PM

    C# Example of API authentication

    I am new to api's and I was wondering if any one had some example code which create's authentication strings similar to Myspace's API Tool (Request Format:By URI).

     I need to be able to create my own authentication strings rather than relying on the API Tool.

    Any help would be appreciated : )

     Thanks guys,

     Ian. 

     I have listed my code below:

    I am using HttpWebRequest's to send a request and then reading the data retrieved.

    string str1="http://api.msappspace.com/v1/users/39553482/profile.xml?oauth_consumer_key=4234F2B2-B4E3-420a-9839-7966192982A1&oauth_nonce=62422021702774888&oauth_signature=0K424l0rteTJ5HhvdFICrC4wVc%3D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1203105370&oauth_token=&oauth_version=1.0";

    HttpWebRequest request = WebRequest.Create(str1) as HttpWebRequest;

            // Add authentication to request 
            request.Credentials = new NetworkCredential("user", "password");

            // Get response 
            using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
            {
                // Get the response stream 
                XmlTextReader reader = new XmlTextReader(response.GetResponseStream());
     

  • 02-18-2008 10:50 PM In reply to

    Re: C# Example of API authentication

    I have posted up a myspace toolkit. You can check it out at http://www.codeplex.com/myspacetoolkit

    Additionally, you can read about my experience integrating into the REST API's via .NET C# on my blog entry. It took a couple of days to get past some of the initial issues with authenticating. It mostly had to do with how the example OAuth C# class was written and how myspace requires the authentication token.
    http://www.joedeveloper.net/blog/post/MyspaceToolkit.aspx

    Give me feedback on what you think of the initial toolkit.

    http://www.oauth.net information about the authentication method used.

    Soon enough, I'll be adding in an XML parser class and using an existing JSON parser class so that there can be serialization done to create objects for the responses.

    Thanks!
    Joseph Farrar

  • 02-28-2008 3:59 AM In reply to

    • Sibin
    • Not Ranked
    • Joined on 02-21-2008
    • Posts 3

    Re: C# Example of API authentication

    Hello Joseph,

                               Thanks a lot for your toolkit. It really works. Have you done with the parser? This will be a great tool for all myspace developers. If you are done with it, then please share the code with us. I am in great need of it.

     

    Thanks in advance

    Sibin

  • 03-23-2009 12:53 PM In reply to

    258 Video tutorials for developers free!!!

     258 Video tutorials free!!!

    www.mrbool.com

    Mr. Bool it’s a web site dedicated exclusively for software developers. Actually, most part of our content is focused to .Net, but we already have stuff about Java and Database too.
    The spread of Mr.Bool is that 90% of our content is in the form of video lessons. We already have more than 250 videos and every month we produce more 10 new videos. And this material is totally free at our website! This website is helping a lot of developers and we would like to help so much more.

    Take a look at Mr. Boo and know a little bit more about tour services. We’re sure that you’re going to like it too!

    *258 Video tutorials
    *4 online courses
    *44 articles

    * Contact us

    Gladstone Matos

    gladstone@clubedelphi.net

    Kaline Dolabella

    kaline@devmedia.com.br


Page 1 of 1 (4 items)