Options

new API release - 12/15/04

onethumbonethumb Administrators Posts: 1,269 Major grins
This one is minor, please refer to this thread for the last major revision.

The album methods have been updated slightly to support the two new fields, SortMethod and SortDirection, used by galleries to determine the order of photos displayed.

You can find the info in the documentation and more information about the features themselves in this thread .

This will be the last change of 2004. Expect more early next year.

Enjoy!

Don

Comments

  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 15, 2004
    Awesome!
    I guess I asked too early:-)rolleyes1.gif
    Thanks for the update!thumb.gif
    Cheers!1drink.gif
    "May the f/stop be with you!"
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 15, 2004
    reSortAlbum question
    Don,
    do I understand it correctly that reSortAlbum API is gonna be retired pretty soon and shall not be used, now that we have more extensive version of it in createAlbum/changeAlbumSettings?
    Thanks!
    "May the f/stop be with you!"
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 16, 2004
    Just tested: new arguments do not work:-(
    Added the two new album parameters to my framework and tried createAlbum - to no avail..

    Here's a sample request:
    [PHP]0:00:46: Post to http://upload.smugmug.com/xmlrpc/
    <?xml version="1.0"?>
    <methodCall>
    <methodName>createAlbum</methodName>
    <params>
    <param><value>c8e8aee10f434bd296cabf72232ad1d1</value></param>
    <param><value>NWO3</value></param>
    <param><value><int>0</int></value></param>
    <struct>
    <member>
    <name>SubCategoryID</name>
    <value><int>48284</int></value>
    </member>
    <member>
    <name>Description</name>
    <value>should be by file name/ descending</value>
    </member>
    <member>
    <name>SortMethod</name>
    <value>FileName</value>
    </member>
    <member>
    <name>SortDirection</name>
    <value><boolean>1</boolean></value>
    </member>
    <member>
    <name>Public</name>
    <value><boolean>1</boolean></value>
    </member>
    <member>
    <name>Filenames</name>
    <value><boolean>0</boolean></value>
    </member>
    <member>
    <name>Comments</name>
    <value><boolean>1</boolean></value>
    </member>
    <member>
    <name>External</name>
    <value><boolean>1</boolean></value>
    </member>
    <member>
    <name>EXIF</name>
    <value><boolean>1</boolean></value>
    </member>
    <member>
    <name>Share</name>
    <value><boolean>1</boolean></value>
    </member>
    <member>
    <name>Printable</name>
    <value><boolean>1</boolean></value>
    </member>
    <member>
    <name>Originals</name>
    <value><boolean>0</boolean></value>
    </member>
    <member>
    <name>Header</name>
    <value><boolean>1</boolean></value>
    </member>
    <member>
    <name>Larges</name>
    <value><boolean>1</boolean></value>
    </member>
    <member>
    <name>Clean</name>
    <value><boolean>0</boolean></value>
    </member>
    <member>
    <name>Protected</name>
    <value><boolean>0</boolean></value>
    </member>
    <member>
    <name>Watermark</name>
    <value><boolean>0</boolean></value>
    </member>
    </struct>
    </params>
    </methodCall>[/PHP]

    The key part:
    [PHP] ...
    <member>
    <name>SortMethod</name>
    <value>FileName</value>
    </member>
    <member>
    <name>SortDirection</name>
    <value><boolean>1</boolean></value>
    </member>
    ...
    [/PHP]

    I tried several times: each time new album is created with Position/Ascending, while I requested FileName/Descending..

    What am I doing wrong? Name again?

    Thanks
    "May the f/stop be with you!"
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 16, 2004
    More on the same subject
    I tried to update these two new properties manually.
    SortMethod seems to work, but SortDirection keeps "Ascending" value regadless of my input.

    I looked into html source - seems like all my names are identical to those used in the form. So I still have no clue why my test didn't produce desired results.

    Don?
    "May the f/stop be with you!"
  • Options
    gusgus Registered Users Posts: 16,209 Major grins
    edited December 16, 2004
    If i take no notice of this stuff...will anything bad happen to me ?

    Can i just log on to SM...open my folder & just upload as i have always done or is this some new system that i will have to learn ?
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 16, 2004
    Not that I'm aware of
    Humungus wrote:
    If i take no notice of this stuff...will anything bad happen to me ?

    Can i just log on to SM...open my folder & just upload as i have always done or is this some new system that i will have to learn ?
    If you don't do anything, everything would be as it was..

    HTH
    "May the f/stop be with you!"
  • Options
    gusgus Registered Users Posts: 16,209 Major grins
    edited December 16, 2004
    Nikolai wrote:
    If you don't do anything, everything would be as it was..

    HTH
    Thankyou...as you were please.
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 16, 2004
    Don,
    any comments on the new API not working? Or is it me again?ne_nau.gif
    "May the f/stop be with you!"
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 16, 2004
    List of outstanding API bugs
    • loginAnonymous - allows to log in, but does not allow to perform any actions, including logout
    • createAlbum - SortMethod and SortDirection parameters are ignored. Moreover, SortDirection ignored even when working via smugmug's own UI
    Don, can we have those fixed for Christmas;-)?

    Thanks!
    "May the f/stop be with you!"
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 20, 2004
    createAlbum works!
    Nikolai wrote:
    • createAlbum - SortMethod and SortDirection parameters are ignored. Moreover, SortDirection ignored even when working via smugmug's own UI
    Don, thank you!thumb.gif
    "May the f/stop be with you!"
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 25, 2004
    Found a few bugs and annoyances
    First of all - Merry Christmas!

    Bugs:
    • createAlbum.Title
      Errors out if values contains any of: &, <
      tried to replace them with & a m p ; and & l t ; , but to no avail
    • createAlbum.Description
      Errors out if values contains any of: &, <, ' (like in it's)
    • Upload Via Post.Caption
      converts ' and " to \' and \"
    For the "official" smugmug UI createAlbum's issues do not exist as far as it's using multipart form, However, at API level we don't have this luxury..:-(

    I can't understand the image caption issue, though. AFAIK both API and web code presumably use the same method.
    Don, am I doing somthing wrong (or not doing somthing required) here?

    Annoyances:
    Neither from UI, nor from API one can
    • delete an empty gallery
    • delete several galleries at once
    I understand that this is probably not a major concern for a normal user, but I had a rough time lately trying to clean up my "Other" category after all my SE tests...

    Would be nice to have the bugs fixed some time soon... I was trying to create an XMas album with the words "it's" (as in "It's Christmas":-) in the description... You can imagine my frustration when I realized I can't do it..
    "May the f/stop be with you!"
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 27, 2004
    I hate to be such a pain in the ahrse, but..
    Nikolai wrote:
    Bugs:
    • createAlbum.Title
      Errors out if values contains any of: &, <
      tried to replace them with & a m p ; and & l t ; , but to no avail
    • createAlbum.Description
      Errors out if values contains any of: &, <, ' (like in it's)
    • Upload Via Post.Caption
      converts ' and " to \' and \"
    ...can somebody from smugmug give me an ETA on those? Or tell me I'm plain wrong and it works for everybody else..

    Thanks!
    "May the f/stop be with you!"
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited December 29, 2004
    Don, Baldy, anyone?
    Nikolai wrote:
    ...can somebody from smugmug give me an ETA on those? Or tell me I'm plain wrong and it works for everybody else..
    Just a very friendly reminder ..deal.gif :-)

    Thanks!
    "May the f/stop be with you!"
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited January 4, 2005
    It's me again!
    Nikolai wrote:
    Just a very friendly reminder ..deal.gif :-)

    Thanks!
    Are you guys back? How about them API bugs?

    Cheers!1drink.gif
    "May the f/stop be with you!"
  • Options
    onethumbonethumb Administrators Posts: 1,269 Major grins
    edited January 6, 2005
    Nikolai wrote:
    ...can somebody from smugmug give me an ETA on those? Or tell me I'm plain wrong and it works for everybody else..

    Thanks!

    I haven't had a chance to take a look at this, but again, I think this is your bug, not mine. We can enter those characters fine in HTML forms and submit them, so there's no reason your app can't do the same.

    I assume you're correctly formatting, in XML, the & and < and whatnot? XML is picky about special chars. Check the docs. If Delphi has XML support, I'm sure it has a function to properly encode strings for use in XML. Just dump them through that function and you should be fine. If not, you might need to whip up a translator function, but it shouldn't be tough.

    The quotes thing is a little more suspicious, that might very well be my bug.

    Don
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited January 6, 2005
    Don
    onethumb wrote:
    I haven't had a chance to take a look at this, but again, I think this is your bug, not mine. We can enter those characters fine in HTML forms and submit them, so there's no reason your app can't do the same.

    I assume you're correctly formatting, in XML, the & and < and whatnot? XML is picky about special chars. Check the docs. If Delphi has XML support, I'm sure it has a function to properly encode strings for use in XML. Just dump them through that function and you should be fine. If not, you might need to whip up a translator function, but it shouldn't be tough.

    The quotes thing is a little more suspicious, that might very well be my bug.

    Don
    With all due respect...
    You said it yourself: you're entering all those titles and descriptions in a FORM - which mostl likely does not use your own API and does not use RPC-XML at all...
    If you noticed, I didn't complain about & and < for upload via post (that one only has ' and " problem), But createAlbum method does not use form-multipart, it's just straight RPC-XML.
    And yes, I tried to encode those characters as & a m p ; and & l t ; - only to get the same error.
    If you're telling me I should use different encoding - please let me know which one. I do have various encoding options, but which one to use?
    --
    Glad you're back:-) I already started to think you put me into your ignore list;-):D
    Cheers!1drink.gif
    "May the f/stop be with you!"
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited January 8, 2005
    & and < works, still an issue with ' in desc...
    onethumb wrote:
    I haven't had a chance to take a look at this, but again, I think this is your bug, not mine. We can enter those characters fine in HTML forms and submit them, so there's no reason your app can't do the same.

    I assume you're correctly formatting, in XML, the & and < and whatnot? XML is picky about special chars. Check the docs. If Delphi has XML support, I'm sure it has a function to properly encode strings for use in XML. Just dump them through that function and you should be fine. If not, you might need to whip up a translator function, but it shouldn't be tough.

    The quotes thing is a little more suspicious, that might very well be my bug.

    Don
    Don,
    first of all I'd like to apologizebowdown.gif : & and < was my fault, forgot to add ';' at the end. Shame on me..:cry

    However, I still have a problem with an apostophe (' aka & # 39 ; aka ') in createAlbum.Description field. Any of the above methods works in createAlbum.Title, but none of them works in Description - screate error. Quotes (" aka & q u o t ;) work just fine in both.
    And I'm using the same piece of code for all my rpcxml encoding, so I wonder if you could possibly look at that apostophe issue on your side?

    Also - still an issue with \' and \" in image captions. Did you have a chance to look at it?

    Thanks!
    "May the f/stop be with you!"
  • Options
    NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited January 8, 2005
    Correction..
    Just tried to create a very weird album with an image with a very weird name.

    Album.Title/Image.Caption: ?/,.<>;:"[]{}~`!@#$%^&amp;*()_+-='
    Album.Description: ?/,.<>;:"[]{}~`!@#$%^&amp;*()_+-=
    (i.e. w/o apostophe)
    1. Image created
    2. Image caption does not show at all
    3. I cannot edit this caption or multiple captions from smugmug UI
    4. If style is set to all thumbs - thumb is not shown at all
    Don, maybe this test case would help to locate the problem?

    Thanks!
    "May the f/stop be with you!"
Sign In or Register to comment.