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 2 of 4 (60 items) < Previous 1 2 3 4 Next >
Sort Posts: Previous Next
  • 02-25-2008 10:40 AM In reply to

    Re: .NET Client Libraries for REST?

    Can you provide a little more information about your situation? Without knowing if you have created an APP on the MDP and whether or not it is installed on your account it's hard to diagnose the issue.

    Are you able to run the example? If not what is the error?

    Additionally, what version of visual studio are you running? VS2005 or 2008?

    There are multiple failure points, but without knowing more I wouldn't be able to help.

    Thanks!
    Joseph

  • 02-25-2008 11:46 AM In reply to

    • Dustin
    • Not Ranked
    • Joined on 02-05-2008
    • Posts 9

    Re: .NET Client Libraries for REST?

    I am using VS2008 Express Editions.

     

     If I run the app it gives me this error: CS0246: The type or namespace name 'MyspaceToolkit' could not be found (are you missing a using directive or an assembly reference?)

  • 02-25-2008 9:17 PM In reply to

    Re: .NET Client Libraries for REST?

    Have you added a reference to the MyspaceToolkit.dll? If not you can right click inside your solution explorer on the Bin folder and say Add Reference. Then navigate to the location of the MyspaceToolkit.dll and add the reference.

    If you already have a reference to the DLL and you are trying to use it in an existing project you also need to import it into you code.

    C#
    using MyspaceToolkit;

    VB
    Import MyspaceToolkit

    You should then be able to access the classes as described in the example application. I'll be releasing an update to the current version shortly. This would allow you to make calls directly to the MyspaceClient class instead of the transaction layer.

    Ex: MyspaceClient mc = new MyspaceClient("AppKey", "SecretKey", "ApiVersion", "APIEndpointUrl", ..... etc.);

    mc.GetFriends("UserId");

    Thanks!
    Joseph

  • 02-26-2008 4:06 PM In reply to

    • Dustin
    • Not Ranked
    • Joined on 02-05-2008
    • Posts 9

    Re: .NET Client Libraries for REST?

    I don't know what I am doing. I went to the bin folder and added the reference even though the file was all ready in the bin folder. I also checked and I had using MySpaceToolkit;

     

    I still get: CS0246: The type or namespace name 'MyspaceToolkit' could not be found (are you missing a using directive or an assembly reference?)

     

    I have also downloaded the 90 day trial of VS2008  and that did not make a difference either.

  • 02-26-2008 9:06 PM In reply to

    Re: .NET Client Libraries for REST?

    Can you copy and paste the entire code sample in here? Have you imported the reference via the code I gave you?

    I guess another good question is... are you using the sample application I have available to download from codeplex?

    If not try that out.. because it should work without you having to do anything...

    Thanks!
    Joseph

  • 02-27-2008 6:48 PM In reply to

    • Dustin
    • Not Ranked
    • Joined on 02-05-2008
    • Posts 9

    Re: .NET Client Libraries for REST?

     I used the sample application to start with and was getting that same error.

  • 02-28-2008 1:23 AM In reply to

    Re: .NET Client Libraries for REST?

    Anyone else getting error from adding the DLL as a reference or trying to build the application? From what I have heard no one has experienced any issues.

    The real error that you are getting is specifically in regards to the fact that the DLL is not referenced in the project or is not being imported with a 

    C#
    using MyspaceToolkit; 
    or
    VB
    Imports MyspaceToolkit

    and the code without this can't access it, unless explicitly referenced which I will talk about in a minute.

    I use VS2008 Pro & VS2005 Pro but it has to do with .NET and not the version of IDE.

    Another thing to try is create a brand new website project by going to File>>>New Website. Then once it's created add a reference to the .NET 3.5 DLL (if you created a .NET 3.5 website, otherwise use the .NET 2.0 DLL with your 2.0 Website) and see if you can access the methods and compile the website without getting the error.

    If all else fails you still can prepend every reference to classes inside the MyspaceToolkit namespace by doing

    MyspaceToolkit.HttpPostUtility hpu = new MyspaceToolkit.HttpPostUtility();

    This is not necessary when using import or using statements.

    Let me know if this helps at all.

    Thanks,
    Joseph

  • 03-04-2008 9:59 PM In reply to

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

    Re: .NET Client Libraries for REST?

    I think I got the example code incorporated and set up but when I fire it up I get this:

    - <error xmlns="api-v1.myspace.com">
      <statuscode>401</statuscode>
      <message>Authentication failed. Failed to resolve application URI "http://www.myspace.com/330683734"</message>
      </error>
     
    The 330683734 is from my test apps profile.

     

  • 03-04-2008 10:24 PM In reply to

    Re: .NET Client Libraries for REST?

    Maybe it was just a fluke? Or is it consistently happening?

    I'm not having an issue with a new application I just created in myspace, but perhaps you have found some bug in the toolkit. I'm interested to see if we can find out why it's happening.

    It would be great if they had a list of all the possible error messages and what they specifically meant.

    Thanks!
    Joseph

  • 03-04-2008 10:38 PM In reply to

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

    Re: .NET Client Libraries for REST?

    It's happening consistently right now. I assume that I got the consumer key from the right place?

    Also, I am using my own userid to construct the user URI: http://api.msappspace.com/v1/users/326710519.xml

    If this were all working correctly, what would I expect to see? Does the auth code redirect back to my app with the token and tokensecret that I use in the HttpPostUtility?

  • 03-04-2008 10:51 PM In reply to

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

    Re: .NET Client Libraries for REST?

    I changed the "consumer key" to match the "appliction uri" that I specified in my application's information and got user information about me. I guess I am logged in? Still wondering if I need token and tokensecret for HttpPostUtility.MyspaceRequest but it's late...

     

    - <user xsi:schemaLocation="https://api.myspace.com/myspace.xsd" xmlns="api-v1.myspace.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <userid>326710519</userid>
      <uri>http://api.msappspace.com/v1/users/326710519</uri>
      <displayname>Peter</displayname>
      <weburi>http://www.myspace.com/peteoleary</weburi>
      <imageuri>http://a763.ac-images.myspacecdn.com/images01/92/s_48bf5da1e374ff028c7ca2d0ed2f5502.jpg</imageuri>
      <largeimageuri>http://a763.ac-images.myspacecdn.com/images01/92/l_48bf5da1e374ff028c7ca2d0ed2f5502.jpg</largeimageuri>
      <usertype>RegularUser</usertype>
      </user>

     

  • 03-04-2008 11:08 PM In reply to

    Re: .NET Client Libraries for REST?

    Well actually the Token and TokenSecret aren't utilized in the current implementation from myspace.

    The whole idea with this new authentication library (OAuth) is that you shouldn't need to pass a username and password to authenticate. The reason being, in the background there is some secure hashing going on. On the myspace server this information is validated.

    anyone correct me if I am wrong, but you can access this information with or without a user being logged in.

    By you authenticating with the myspace toolkit (in the background OAuth.cs) you are really logging in at that moment to get the data.
    I'm working on further developing the myspacetoolkit I wrote to parse either the XML or JSON based on your selection into actual classes (Serialize & Deserialize).

    Once I do this it will be the abstraction to the HttpPostUtility class... which really is only a helper class. It was quick and dirty for me to write the initial release like this, but in the future you would see something like the following:

    MyspaceClient mc = new MyspaceClient(ConsumerKey, ConsumerSecret, APIurl, APIversion);
    UserProfile uProf = new UserProfile();

    uProf = mc.GetBasicProfile(userID);
    uProf.DisplayName;

    I've been kind of busy working on other projects, but I will try to get this release out this month.

    Let me know if you have any other questions.

    -Joseph

  • 03-05-2008 9:31 AM In reply to

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

    Re: .NET Client Libraries for REST?

    Okay, I got it now. I was thinking that you had to use OAuth to get a session token, which you do not have to do.

    Each call to the REST API authenticates itself with the code that you've already provided. Cool.

    I have whipped up a handful of C# objects which read the resulting XML from a couple of calls. They are very minimal and do no error or type checking but I would be happy to share them if they will help anyone. 

  • 03-05-2008 11:20 AM In reply to

    Re: .NET Client Libraries for REST?

    Are you on Codeplex as a user peter? If so I'll add on you on as a developer. Then when you have patches or updates you can check them in so everyone can benefit from it.

     

    Thanks

    Joseph

  • 03-05-2008 7:55 PM In reply to

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

    Re: .NET Client Libraries for REST?

    I am pete_oleary on CodePlex

    I just uploaded a patch (my first ever on CodePlex) which is a single .cs file with some basic objects with XML parsing. No error checking of any kind. Let me know if it works okay: the upload and the code.

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