Options

new API release - Mar 4, 2005

2»

Comments

  • Options
    onethumbonethumb Administrators Posts: 1,269 Major grins
    edited March 8, 2005
    arthill wrote:
    We need WSDL! I'm definitely a rookie at all this stuff but was able to quickly figure out how to use Web Services at Amazon and can't figure out what to do with XML-RPC. I am skeptical of your claim that XML-RPC is the most common web services interface.
    But, I'm not trying to start an argument and you probably know a hell of a lot more about this than I do. I just want a WSDL file so I can program to a proxy and not have to get my hands dirty. 1drink.gif

    Ahh, WSDL. I see where you're coming from, now. Unfortunately, I have some bad news: WSDL is used in conjuction with SOAP and we're not likely to support SOAP anytime soon.

    Why, you might ask? Because SOAP is far more complicated than it needs to be, and as a result, is harder to build for, slower to process requests, and generally more error-prone.

    In fact, I've chatted with the head of Amazon's API division and have some interesting facts for you. They built both a REST and a SOAP interface. SOAP requests take 6X as long to process, and 85% of the API calls are made via REST, not SOAP. Amazon spent a ton of time and effort on SOAP (more than REST), and yet almost no-one uses it.

    The smugmug API is a labor of love by yours truly, and I just don't have enough hours in the day to write (and, more importantly, maintain!) 3 different interfaces. XML-RPC has been around the longest, it's very lightweight (look at the size and structure of the requests!), and lots of existing libraries and whatnot exist for it.

    REST will definitely be the next target, once there's enough demand and I have some spare time. SOAP is a long-shot and I wouldn't be surprised if it never happens.

    Wish I had better news, but honestly, you're the very first person I can remember asking for either REST or SOAP, so I haven't been inclined (yet) to work on either.

    Don
  • Options
    arthillarthill Registered Users Posts: 62 Big grins
    edited March 8, 2005
    onethumb wrote:
    Ahh, WSDL. I see where you're coming from, now. Unfortunately, I have some bad news: WSDL is used in conjuction with SOAP and we're not likely to support SOAP anytime soon.

    Why, you might ask? Because SOAP is far more complicated than it needs to be, and as a result, is harder to build for, slower to process requests, and generally more error-prone.

    In fact, I've chatted with the head of Amazon's API division and have some interesting facts for you. They built both a REST and a SOAP interface. SOAP requests take 6X as long to process, and 85% of the API calls are made via REST, not SOAP. Amazon spent a ton of time and effort on SOAP (more than REST), and yet almost no-one uses it.

    The smugmug API is a labor of love by yours truly, and I just don't have enough hours in the day to write (and, more importantly, maintain!) 3 different interfaces. XML-RPC has been around the longest, it's very lightweight (look at the size and structure of the requests!), and lots of existing libraries and whatnot exist for it.

    REST will definitely be the next target, once there's enough demand and I have some spare time. SOAP is a long-shot and I wouldn't be surprised if it never happens.

    Wish I had better news, but honestly, you're the very first person I can remember asking for either REST or SOAP, so I haven't been inclined (yet) to work on either.

    Don
    Well thanks for the quick reply and the education. I stand corrected. Regardless, I love smugmug, as you know since I was interviewed by the Chicago Tribune. I'm sure you're right, I'm just not up to figuring it out. No matter, I shall continue as an avid smugmug fan even if I never figure out how to program to it. Thanks for creating and doing smugmug. You guys are the best.
    In theory, there is no difference between theory and practice. In practice, however, there is.
    In order to understand recursion, you first have to understand recursion.
    Art Hill
  • Options
    Aaron ChristyAaron Christy Registered Users Posts: 30 Big grins
    edited March 8, 2005
    Login Problems
    It appears that I am still having some problems with the loginAnonymous method.

    Here is my request:
    [PHP]
    <?xml version="1.0"?>
    <methodCall>
    <methodName>loginAnonymously</methodName>
    <params>
    <param>
    <value>
    <string>1.0</string>
    </value>
    </param>
    </params>
    </methodCall> [/PHP]

    And here is my reply:
    [PHP]
    <?xml version="1.0" encoding="iso-8859-1"?>
    <methodResponse>
    <fault>
    <value>
    <struct>
    <member>
    <name>faultCode</name>
    <value>
    <int>7</int>
    </value>
    </member>
    <member>
    <name>faultString</name>
    <value>
    <string>anonymous login not permitted</string>
    </value>
    </member>
    </struct>
    </value>
    </fault>
    </methodResponse> [/PHP]

    I've tried posting this securely via https or open. Same issue.

    I hope there is something obvious that I am missing.

    Any ideas?
    ..........................................................

    Aaron Christy
    http://www.surfacedamage.com/
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited March 8, 2005
    Technically speaking..:-)
    onethumb wrote:
    ...you're the very first person I can remember asking for either REST or SOAP, so I haven't been inclined (yet) to work on either....
    .. I asked about some kind of web-services (specifically SOAP/WSDL) in mid-November 2004:-). It was an email, though, so you probably didn't get it..

    Ben pointed me to the semi-secret at the time:-) hacks page with RPC-XML API.

    I reluctantly (never used RPC-XML before) tried it - and just a couple weeks later first copy of smugmugexplorer was up, running and deployed to the website.

    I agree - RPC-XML is WAY easier and lighter than SOAP..

    Cheers!1drink.gif
    "May the f/stop be with you!"
  • Options
    Aaron ChristyAaron Christy Registered Users Posts: 30 Big grins
    edited March 8, 2005
    It appears that I am still having some problems with the loginAnonymous method.
    Originally, I thought the loginWithPassword was working, but now it does not seem to, but the results are even a little stranger.

    Here is my request:
    [PHP] <?xml version="1.0"?>
    <methodCall>
    <methodName>loginWithPassword</methodName>
    <params>
    <param>
    <value>
    <string>myemail@myemail.com</string>
    </value>
    </param>
    <param>
    <value>
    <string>mypassword</string>
    </value>
    </param>
    <param>
    <value>
    <string>1.0</string>
    </value>
    </param>
    </params>
    </methodCall>
    [/PHP]

    Here is my reply:
    [PHP] <?xml version="1.0" encoding="iso-8859-1"?>
    <methodResponse>
    <params>
    <param>
    <value>
    <struct>
    <member>
    <name>SessionID</name>
    <value>
    <string/>
    </value>
    </member>
    <member>
    <name>UserID</name>
    <value>
    <int>20690</int>
    </value>
    </member>
    <member>
    <name>PasswordHash</name>
    <value>
    <string>$1$X/r8yPWc$LD2PEPR/b9iPbTDID6jq61</string>
    </value>
    </member>
    </struct>
    </value>
    </param>
    </params>
    </methodResponse> [/PHP]


    Any reason why I would get a hash and userid back, but no session?
    ..........................................................

    Aaron Christy
    http://www.surfacedamage.com/
  • Options
    onethumbonethumb Administrators Posts: 1,269 Major grins
    edited March 8, 2005
    Originally, I thought the loginWithPassword was working, but now it does not seem to, but the results are even a little stranger.

    Here is my request:
    [PHP] <?xml version="1.0"?>
    <methodCall>
    <methodName>loginWithPassword</methodName>
    <params>
    <param>
    <value>
    <string>myemail@myemail.com</string>
    </value>
    </param>
    <param>
    <value>
    <string>mypassword</string>
    </value>
    </param>
    <param>
    <value>
    <string>1.0</string>
    </value>
    </param>
    </params>
    </methodCall>
    [/PHP]

    Here is my reply:
    [PHP] <?xml version="1.0" encoding="iso-8859-1"?>
    <methodResponse>
    <params>
    <param>
    <value>
    <struct>
    <member>
    <name>SessionID</name>
    <value>
    <string/>
    </value>
    </member>
    <member>
    <name>UserID</name>
    <value>
    <int>20690</int>
    </value>
    </member>
    <member>
    <name>PasswordHash</name>
    <value>
    <string>$1$X/r8yPWc$LD2PEPR/b9iPbTDID6jq61</string>
    </value>
    </member>
    </struct>
    </value>
    </param>
    </params>
    </methodResponse> [/PHP]


    Any reason why I would get a hash and userid back, but no session?

    That *is* strange. I'm doing both just fine and I'm watching dozens to hundreds of people doing it right now on the site.

    Can you send your entire HTTP request with all headers you sent and received?

    Something strange is afoot at the Circle K....

    Don
  • Options
    onethumbonethumb Administrators Posts: 1,269 Major grins
    edited March 8, 2005
    arthill wrote:
    Well thanks for the quick reply and the education. I stand corrected. Regardless, I love smugmug, as you know since I was interviewed by the Chicago Tribune. I'm sure you're right, I'm just not up to figuring it out. No matter, I shall continue as an avid smugmug fan even if I never figure out how to program to it. Thanks for creating and doing smugmug. You guys are the best.

    I really wish I had a better answer for you. :(

    XML-RPC truly is easier to program for than SOAP is, so you'll probably find it easier than you might think. I wouldn't give up just yet! :)

    Using a language which has XML-RPC support natively or via libraries, you can literally make calls to smugmug with a dozen lines of code or less.

    What's more, there's a bunch of people here who love to give advice and guidance, so you've got a handful of experts ready to assist.

    Holler if you need any pointers!

    Don
  • Options
    flyingpylonflyingpylon Registered Users Posts: 260 Major grins
    edited March 8, 2005
    We're kind of mixing threads here, but...

    I agree that the XML-RPC interface is not that bad. I definitely would have jumped on the REST bandwagon had it been available, since I already know how to use it after working with Amazon. But despite some initial uncertainty I found XML-RPC quite simple, especially after I discovered that someone else had already written a class for ASP and I could (for the most part) just plug it in and go.

    But I'd be willing to bet that the creation of web-based apps would increase dramatically if Smugmug offered REST, simply because there are so many more people that know how to use it.

    However, I still think that the API should be given someone's full (or mostly full) attention instead of being a side project. It's too important and the potential is too great for it to be deprived that way.
  • Options
    BaldyBaldy Registered Users, Super Moderators Posts: 2,853 moderator
    edited March 8, 2005
    Here's one of the many well-informed rants against SOAP:

    http://www.artima.com/weblogs/viewpost.jsp?thread=95113

    We were at Oreilly's foo camp in the middle of debates over web services APIs and there were equally good arguments for both REST and xml-rpc, but no one defended SOAP.
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited March 9, 2005
    Thanks for the link
    Baldy wrote:
    Here's one of the many well-informed rants against SOAP:

    http://www.artima.com/weblogs/viewpost.jsp?thread=95113

    We were at Oreilly's foo camp in the middle of debates over web services APIs and there were equally good arguments for both REST and xml-rpc, but no one defended SOAP.
    Interesting..
    "May the f/stop be with you!"
  • Options
    Aaron ChristyAaron Christy Registered Users Posts: 30 Big grins
    edited March 9, 2005
    onethumb wrote:
    That *is* strange. I'm doing both just fine and I'm watching dozens to hundreds of people doing it right now on the site.

    Can you send your entire HTTP request with all headers you sent and received?

    Something strange is afoot at the Circle K....

    Don
    Don,

    I'm still working on getting the exact HTTP request. I know what the headers should be, but that doesn't guarantee that is what's being generated.

    You want to see an even stranger request?

    Check this:

    Request:
    [PHP]<?xml version="1.0"?>
    <methodCall>
    <methodName>loginAnonymously</methodName>
    <params>
    <param>
    <value>
    <string>1.0</string>
    </value>
    </param>
    </params>
    </methodCall>[/PHP]

    and the Reply:
    [PHP]
    <?xml version="1.0" encoding="iso-8859-1"?>
    <methodResponse>
    <params>
    <param>
    <value>
    <struct>
    <member>
    <name>SessionID</name>
    <value>
    <string>smugmug@phad.com</string>
    </value>
    </member>
    </struct>
    </value>
    </param>
    </params>
    </methodResponse>[/PHP]

    How would it even know my e-mail address when I did an anonymous request and sent no identifying characteristics?

    More to come...
    ..........................................................

    Aaron Christy
    http://www.surfacedamage.com/
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited March 9, 2005
    The only thing I can think of
    at this point is that the library you use is

    1) not properly written - as nobody else seems to have the same problem
    2) featuring heavy usage of cookies - 'cause I doubt SM server can get your email any other way (unless they track IP addresses and try to match them - which would not make a lot of sense in DHCP world..)

    I would try to find all SM-related cookies and delete them (or clear them all in case you don't care:-)

    HTH
    "May the f/stop be with you!"
  • Options
    Aaron ChristyAaron Christy Registered Users Posts: 30 Big grins
    edited March 9, 2005
    Nikolai wrote:
    at this point is that the library you use is
    1) not properly written - as nobody else seems to have the same problem
    2) featuring heavy usage of cookies - 'cause I doubt SM server can get your email any other way (unless they track IP addresses and try to match them - which would not make a lot of sense in DHCP world..)
    Nik, I mostly agree with you -- something is not quite right, especially since I am the only one experiencing this. However, the library I am using is written in VB and walking through the source, I really cannot find anything that seems incorrect to me. All the requests seem valid and well formed.

    Since I am degugging directly in the IDE and not in the browser, there are no cookies being stored.

    Also, while troubleshooting, I found something interesting that maybe Don can give some explanation to.

    So, on my previous note, I showed how my e-mail address was being returned as the session ID.

    If I call the "GetAlbums" method using my e-mail address as the session ID parameter, it returns the array of albums. Actually, if I put a bunch of jibberish in the session ID, it returns the albums.

    Don, is any validity being done on the session ID when retrieving publicly available data?
    ..........................................................

    Aaron Christy
    http://www.surfacedamage.com/
  • Options
    onethumbonethumb Administrators Posts: 1,269 Major grins
    edited March 9, 2005
    Nik, I mostly agree with you -- something is not quite right, especially since I am the only one experiencing this. However, the library I am using is written in VB and walking through the source, I really cannot find anything that seems incorrect to me. All the requests seem valid and well formed.

    Since I am degugging directly in the IDE and not in the browser, there are no cookies being stored.

    Also, while troubleshooting, I found something interesting that maybe Don can give some explanation to.

    So, on my previous note, I showed how my e-mail address was being returned as the session ID.

    If I call the "GetAlbums" method using my e-mail address as the session ID parameter, it returns the array of albums. Actually, if I put a bunch of jibberish in the session ID, it returns the albums.

    Don, is any validity being done on the session ID when retrieving publicly available data?


    The reason I ask about the headers is that it looks suspiciously like you might be sending a smugmug cookie or something along with your request.

    loginAnonymously() will actually continue an existing session if you send the SessionID in the right cookie (iow, were logged into the smugmug site).

    There have been cases where non-IE applications use IE to make HTTP requests and end up using IE's stored cookies and settings. This could easily be that.

    Check it out, let me know. Doing a capture of the actual bytes being sent and received would be most helpful.

    Don
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited March 9, 2005
    Along with what Don said
    Aaron,
    If the "library" is writen in VB, high chances are that it uses MS' wininet, or, even more likely, winhttp API, which most definitely use all availalble IE resources.

    Hence, my suggestion to clear the cookies stands:-)

    HTH
    "May the f/stop be with you!"
  • Options
    Aaron ChristyAaron Christy Registered Users Posts: 30 Big grins
    edited March 9, 2005
    Cookies for lunch
    Nikolai wrote:
    If the "library" is writen in VB, high chances are that it uses MS' wininet, or, even more likely, winhttp API, which most definitely use all availalble IE resources.
    Nik,

    You are correct, it is using wininet for http calls. I was having trouble getting the exact http xml-rpc call while debugging, so I installed a packet sniffer and had to reboot. After rebooting, everything seems to be working as expected.

    This would lead some credence to you and Don's "cookie" theory.

    I'll keep an eye on it and see if it creeps back up.

    Thank you both for your suggestions!
    ..........................................................

    Aaron Christy
    http://www.surfacedamage.com/
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited March 10, 2005
    Glad you cleared that issue out
    Tough cookie:-)

    Cheers!1drink.gif
    "May the f/stop be with you!"
  • Options
    mattmattbobattmattmattbobatt Registered Users Posts: 17 Big grins
    edited March 11, 2005
    getAlbumTemplates
    When I call getAlbumTemplates I get back a struct full of strings. The Docs say that it should have lots of bools a few ints and a couple of strings. Is this a bug ? I can work around it but I don't want to if it's going to be fixed.
  • Options
    mattmattbobattmattmattbobatt Registered Users Posts: 17 Big grins
    edited March 11, 2005
    changeAlbumSettings
    I'm still not having any luck with changeAlbumSettings. Doesn't seem to return anything. Has anyone else got it to work ? I'll feel better when I know it's me or not me.

    Matt
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited March 11, 2005
    Didn't try yet..
    ... looks like this time you gonna be the trail blazer:):
    Good luck!thumb.gif
    "May the f/stop be with you!"
  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited March 13, 2005
    When I call getAlbumTemplates I get back a struct full of strings. The Docs say that it should have lots of bools a few ints and a couple of strings. Is this a bug ? I can work around it but I don't want to if it's going to be fixed.
    Matt,

    I have found this a few occasions (including the function, of which u speak), that return values aren't always as advertised.

    David
    David Parry
    SmugMug API Developer
    My Photos
Sign In or Register to comment.