Options

new API release - 12/03/04

2»

Comments

  • Options
    onethumbonethumb Administrators Posts: 1,269 Major grins
    edited December 7, 2004
    rutt wrote:
    Yes, we'll see. I think the argument in this case is sounder than the argument for a monolithic getCategories/subcategories call. And there is an obvious "embarrassingly parallel" implementation so Don can do his own load balancing in these cases, perhaps even more intelligently than the routers would. With the getCategories thing, all the work had to result in a single list so syncronization would be required. In this case the sorts (probably the most expensive possible thing one could do with this) are all independent (or at least should be) and so can be deligated. There is no reason for either of these calls even to wait for completion, although even that would be a relatively small amount of syncronization.

    Those operations are definitely "embarrassingly parallel", but the other component that makes it worth my while is "frequency of use". Since I don't anticipate calls like these would be used all that frequently, I probably won't (at this time) invest the effort to make them load-balance themselves on our backend. I'd just let you submit and send a reply when complete.

    Having said that, it makes sense to have these be options, so I'll see what I can do. And if I'm wrong about the frequency, I can always parallelize them on our backend at a later date with no API change. I like that. :)

    Don
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 7, 2004
    50% again
    onethumb wrote:
    Fixes are up.

    Don
    Just tested:
    • getAllSubCategories work!thumb.gif
    • upload via POST still does not...headscratch.gif
    Thank you for the categories fix!
    Cheers!1drink.gif
    "May the f/stop be with you!"
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 7, 2004
    Taking that back: it does not work...
    Nikolai wrote:
    Just tested:
    • getAllSubCategories work!thumb.gif
    • upload via POST still does not...headscratch.gif
    Thank you for the categories fix!
    Cheers!1drink.gif
    I finally got home and got my hands into the programm. Well, getAllSubCategories now returns somthing, but result is unusable.

    Instead of providing Category ID, Subcategory ID and Subcategory Title, it uses subcategory id twice, thus making each id equal and the whole thing totally useless :-(

    Here is a log excerpt:
    First goes call for all caetgories:

    [PHP]
    <?xml version="1.0"?>
    <methodCall>
    <methodName>getCategories</methodName>
    <params>
    <param><value>3ff8d655e92b68728fe54e8408228861</value></param>
    </params>
    </methodCall>
    .......................................
    <?xml version="1.0" encoding="iso-8859-1"?>
    <methodResponse>
    <params>
    <param>
    <value>
    <array>
    <data>
    <value>
    <struct>
    <member>
    <name>CategoryID</name>
    <value>
    <int>0</int>
    </value>
    </member>
    <member>
    <name>Title</name>
    <value>
    <string>Other</string>
    </value>
    </member>
    </struct>
    </value>
    [/PHP]

    the rest is skipped. OK, Other does have id=0.
    Now, the new method. I have a Test subcategory within Other:
    [PHP]
    <?xml version="1.0"?>
    <methodCall>
    <methodName>getAllSubCategories</methodName>
    <params>
    <param><value>3ff8d655e92b68728fe54e8408228861</value></param>
    </params>
    </methodCall>
    .......
    12/7/2004 7:24:31 PM: Post results
    <?xml version="1.0" encoding="iso-8859-1"?>
    <methodResponse>
    <params>
    <param>
    <value>
    <array>
    <data>
    <value>
    <struct>
    <member>
    <name>CategoryID</name>
    <value>
    <int>48284</int>
    </value>
    </member>
    <member>
    <name>SubCategoryID</name>
    <value>
    <int>48284</int>
    </value>
    </member>
    <member>
    <name>Title</name>
    <value>
    <string>test</string>
    </value>
    </member>
    </struct>
    </value>
    ...............
    [/PHP]
    Parsing this shows this line:
    12/7/2004 7:24:31 PM:	 Finished Getting all sub categories for PhotoSoCal (0:00:01)
    12/7/2004 7:24:31 PM:	 CategoryID=48284, SubCategoryID=48284, Title=test
    ....
    

    So, instead of 0 we have first item 28284.

    Don, it seems like an easy fix.. If you please?

    Thanks!
    "May the f/stop be with you!"
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 7, 2004
    sorry for the typos
    Nikolai wrote:
    Parsing this shows this line:
    12/7/2004 7:24:31 PM:	 Finished Getting all sub categories for PhotoSoCal (0:00:01)
    12/7/2004 7:24:31 PM:	 CategoryID=48284, SubCategoryID=48284, Title=test
    ....
    

    So, instead of 0 we have first item 28284.

    Don, it seems like an easy fix.. If you please?

    Thanks!
    The red line should read:
    So, instead of 0 we have first item 48284.
    "May the f/stop be with you!"
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 7, 2004
    Starting a "onethumbup" list..
    In this branch I'm gonna post separate messages for each API I personally verified. Everybody is welcome to follow, so we can share the load:-).
    "May the f/stop be with you!"
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 7, 2004
    loginWithPassword
    works thumb.gif
    "May the f/stop be with you!"
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 7, 2004
    loginWithHash
    worksthumb.gif
    "May the f/stop be with you!"
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 7, 2004
    loginAnonymously
    worksthumb.gif
    "May the f/stop be with you!"
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 7, 2004
    logout
    worksthumb.gif (Duh!:-)
    "May the f/stop be with you!"
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 7, 2004
    getCategories
    worksthumb.gif
    "May the f/stop be with you!"
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 7, 2004
    getSubCategories
    worksthumb.gif
    "May the f/stop be with you!"
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 7, 2004
    getAlbums
    worksthumb.gif
    "May the f/stop be with you!"
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 7, 2004
    createAlbum
    worksthumb.gif
    "May the f/stop be with you!"
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 7, 2004
    upload
    works - both with extra info (version '1.0')thumb.gif and without it (versionless)thumb.gif
    "May the f/stop be with you!"
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 7, 2004
    upload via POST (multipart post with xml response)
    • works in versionless modethumb.gif
    • adding ByteCount and/or MD5Sum digest (upper or lower case) result to "format error", code 4. yelrotflmao.gif
    "May the f/stop be with you!"
  • Options
    onethumbonethumb Administrators Posts: 1,269 Major grins
    edited December 8, 2004
    Nikolai wrote:
    • works in versionless modethumb.gif
    • adding ByteCount and/or MD5Sum digest (upper or lower case) result to "format error", code 4. yelrotflmao.gif

    Hmm, well, I just uploaded a bunch of photos fine with both ByteCount and MD5Sum.

    Can you send me your POST output or something? I think you must be doing something wrong.

    Don
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 8, 2004
    Works now!
    Confirmedthumb.gif
    "May the f/stop be with you!"
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 8, 2004
    Don, any progress on this one?
    Nikolai wrote:
    I finally got home and got my hands into the programm. Well, getAllSubCategories now returns somthing, but result is unusable.

    Instead of providing Category ID, Subcategory ID and Subcategory Title, it uses subcategory id twice, thus making each id equal and the whole thing totally useless :-(

    ...skipped..
    Don, it seems like an easy fix.. If you please?
    Thanks!
    "May the f/stop be with you!"
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 8, 2004
    Anonymous login kinda crippled
    onethumb wrote:
    - loginAnonymously now works as advertised. This means non-logged in smugmug users can now browse smugmug using your apps. No login required, but of course, various features and information will be locked.
    I tested this tonite. I can login anonymousle, get the session ID - and then cannot do anything. Any method I tried returns "invalid user" error.
    Methods I tried:
    1. getAlbums
    2. getCategories
    3. Logout
    I can understand the first two, but Logout ...

    I have logs to prove my point, in case you need them...

    Absolutely not a rush, but eventually would be nice to have this fixed..;-)deal.gif

    TIA
    "May the f/stop be with you!"
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 8, 2004
    Sorry to be such an a$$..
    .. but I REALLY need getAllSubCategories to work...
    Again, it simply uses the wrong id, looks like a typical copy-paste error..
    I just tested it again - same thing...
    Please? bowdown.gif
    "May the f/stop be with you!"
  • Options
    onethumbonethumb Administrators Posts: 1,269 Major grins
    edited December 9, 2004
    Nikolai wrote:
    .. but I REALLY need getAllSubCategories to work...
    Again, it simply uses the wrong id, looks like a typical copy-paste error..
    I just tested it again - same thing...
    Please? bowdown.gif

    Try it now.

    Don
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 9, 2004
    Yay!!!
    onethumb wrote:
    Try it now.

    Don
    I works!!! clap.gif
    Thank you very much!thumb.gif

    Cheers!1drink.gif
    "May the f/stop be with you!"
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 9, 2004
    getAllSubCategories
    Works!thumb.gif
    "May the f/stop be with you!"
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 10, 2004
    How am I supposed to create a multiline description?
    If I try to enter more than one line, it returns a fornat error. I understand the reason (chars #13, #10 in the Description), but have no clue how to encode that properly. For now I'm gonnal just make it all one line, but eventually I' d like to see this resolved.
    Don? maybe use base64? or some &.. stuff?
    TIA
    "May the f/stop be with you!"
  • Options
    onethumbonethumb Administrators Posts: 1,269 Major grins
    edited December 13, 2004
    Nikolai wrote:
    If I try to enter more than one line, it returns a fornat error. I understand the reason (chars #13, #10 in the Description), but have no clue how to encode that properly. For now I'm gonnal just make it all one line, but eventually I' d like to see this resolved.
    Don? maybe use base64? or some &.. stuff?
    TIA

    As long as you're sending properly form-encoded data, it should be fine. You can, for example, add multiline descriptions/captions in the HTML interface, which is an incredibly basic form POST.

    Don
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 13, 2004
    I see...
    onethumb wrote:
    As long as you're sending properly form-encoded data, it should be fine. You can, for example, add multiline descriptions/captions in the HTML interface, which is an incredibly basic form POST.

    Don
    Thank you! I guess, my components do not take proper care of the stuff, even though I use proper ''multipart/form-data'' content type. But now I know where to look:-). I though I should use some kind of URI/URL/MIME/etc encoding...
    I'll figure it out now..

    Thanks!thumb.gif
    "May the f/stop be with you!"
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 13, 2004
    Strange, it works now - from work, that is...
    At least for the albums.. Maybe it's different on different machines. Need to check it from home tonite..
    "May the f/stop be with you!"
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 13, 2004
    OK, here it goes
    Nikolai wrote:
    At least for the albums.. Maybe it's different on different machines. Need to check it from home tonite..
    • Multiline album description (createAlbum) - worksthumb.gif
    • Multiline image description - multipart upload (upload via POST) - worksthumb.gif
    • Multiline image description - standard base64 upload (upload) - returns format error! deal.gif
    Don, at this time I have only one question:
    • is this something which is easy to fix and gonna be fixed some time soon (say, this year:-),
      or
    • you simply discourage everybody from using this method and we can forget about the whole problem
    I personally have no issues with the latter:-), I can totally desurface it from UI and don't even leave it as an option.. I only want to know..

    Thank you!
    "May the f/stop be with you!"
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 14, 2004
    Correction: not entirely works
    It lets me in, returns a session, but aftewards I don't seem to be able to do much. Here is an example of attempt to getAlbums (it should return list of public albums, right?):

    [PHP]
    Post to https://upload.smugmug.com/xmlrpc/

    <?xml version="1.0"?>
    <methodCall>
    <methodName>loginAnonymously</methodName>
    <params>
    <param><value>1.0</value></param>
    </params>
    </methodCall>

    Post results

    <?xml version="1.0" encoding="iso-8859-1"?>
    <methodResponse>
    <params>
    <param>
    <value>
    <struct>
    <member>
    <name>SessionID</name>
    <value>
    <string>265a4f4786718c8668db41464606db16</string>
    </value>
    </member>
    </struct>
    </value>
    </param>
    </params>
    </methodResponse>

    Logged in: Session: 265a4f4786718c8668db41464606db16; User: ; Hash:
    Started Gettings list of albums

    Post to http://upload.smugmug.com/xmlrpc/

    <?xml version="1.0"?>
    <methodCall>
    <methodName>getAlbums</methodName>
    <params>
    <param><value>265a4f4786718c8668db41464606db16</value></param>
    </params>
    </methodCall>

    Post results

    <?xml version="1.0" encoding="iso-8859-1"?>
    <methodResponse>
    <fault>
    <value>
    <struct>
    <member>
    <name>faultCode</name>
    <value>
    <int>4</int>
    </value>
    </member>
    <member>
    <name>faultString</name>
    <value>
    <string>invalid user</string>
    </value>
    </member>
    </struct>
    </value>
    </fault>
    </methodResponse>

    [/PHP]

    Am I missing something, or is this a bug?
    Thanks
    "May the f/stop be with you!"
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 20, 2004
    createAlbum works with new extended API
    There was an interim problem with two new sort parameters, but it looks like it's been fixed.
    Cheers!1drink.gif
    "May the f/stop be with you!"
Sign In or Register to comment.