Options

Invalid element names in smugmug.albums.get

peterparkerpeterparker Registered Users Posts: 89 Big grins
I'm working on what appears to be at least the 2nd Aperture exporter plug-in for SmugMug. I ran into a problem with smugmug.albums.get because it has elements names that start with a number. Not allowed according to XML spec. Any chance this will be fixed in the REST API?

Thanks,
David

Comments

  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited November 14, 2006
    I'm working on what appears to be at least the 2nd Aperture exporter plug-in for SmugMug. I ran into a problem with smugmug.albums.get because it has elements names that start with a number. Not allowed according to XML spec. Any chance this will be fixed in the REST API?

    Thanks,
    David
    Hi David,

    Actually, I think you might be the 3rd or 4th :D

    Can you please post your request url and response.

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • Options
    peterparkerpeterparker Registered Users Posts: 89 Big grins
    edited November 14, 2006
    For example...

    <rsp stat="ok">
    <method>smugmug.albums.get</method>
    <0><AlbumID>1991797</AlbumID><Title>Honeymoon</Title><CategoryID>20</CategoryID><Category>Travel</Category></0>
    <1><AlbumID>2033148</AlbumID><Title>Rosi and Max</Title><CategoryID>23</CategoryID><Category>Weddings</Category></1>
    <2><AlbumID>2064700</AlbumID><Title>Erica and Tyler</Title><CategoryID>23</CategoryID><Category>Weddings</Category></2>
    <3><AlbumID>1991630</AlbumID><Title>Apple Stuff</Title><CategoryID>26</CategoryID><Category>Computers</Category></3>
    <4><AlbumID>2000137</AlbumID><Title>Portraits</Title><CategoryID>27</CategoryID><Category>Photography</Category></4>
    </rsp>

    The indexing elements are not necessary and are not valid element names.
  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited November 14, 2006
    hmm...that looks interesting headscratch.gif

    can u please also provide the url that you used to generate this response ?

    As I think you might be using the wrong endpoint.

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited November 14, 2006
    it should look something like this...

    http://api.smugmug.com/hack/rest/1.1.1/?method=smugmug.albums.get&SessionID=[snip]

    and the response...

    [php]
    <rsp stat="ok">
    <method>smugmug.albums.get</method>
    <Albums>
    <Album id="1197151">
    <Title>Lorne</Title>
    <Category id="13">
    <Title>Landscapes</Title>
    </Category>
    </Album>
    <Album id="1068138">
    <Title>Yarra Glen</Title>
    <Category id="13">
    <Title>Landscapes</Title>
    </Category>
    </Album>
    <Album id="1056102">
    <Title>Melbourne</Title>
    <Category id="13">
    <Title>Landscapes</Title>
    </Category>
    </Album>
    <Album id="1031195">
    <Title>Barwon Heads</Title>
    <Category id="13">
    <Title>Landscapes</Title>
    </Category>
    </Album>
    <Album id="929680">
    <Title>Portland</Title>
    <Category id="13">
    <Title>Landscapes</Title>
    </Category>
    </Album></Albums></rsp> [/php]
    David Parry
    SmugMug API Developer
    My Photos
  • Options
    peterparkerpeterparker Registered Users Posts: 89 Big grins
    edited November 14, 2006
    Hmmm, yes I'm just using /rest/ not /rest/1.1.1/

    Odd, I can't get session IDs at the moment from smugmug.login.withPassword.
  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited November 14, 2006
    Hmmm, yes I'm just using /rest/ not /rest/1.1.1/

    Odd, I can't get session IDs at the moment from smugmug.login.withPassword.

    use /rest/1.1.1/ for all calls

    are the sessionIDs coming back as blank or null ?
    David Parry
    SmugMug API Developer
    My Photos
  • Options
    peterparkerpeterparker Registered Users Posts: 89 Big grins
    edited November 14, 2006
    Self-closing empty element with /rest/1.1.1/, empty element with /rest/

    Where are the REST versions documented?
  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited November 14, 2006
    Self-closing empty element with /rest/1.1.1/, empty element with /rest/

    Where are the REST versions documented?

    try clearing your cookie

    http://smugmug.jot.com/WikiHome
    David Parry
    SmugMug API Developer
    My Photos
  • Options
    peterparkerpeterparker Registered Users Posts: 89 Big grins
    edited November 14, 2006
    Cancel that, found the 1.1.1 info in the Wiki.
  • Options
    peterparkerpeterparker Registered Users Posts: 89 Big grins
    edited November 14, 2006
    That did the trick, thanks. And the 1.1.1 XML looks much better.
  • Options
    wschwartzwschwartz Registered Users Posts: 10 Big grins
    edited November 29, 2006
    This thread just helped me solve the exact same problem I was having. thanks!

    Another question on this method: is the album list returned always sorted by date last updated? Or is it date last modified? Is there a parameter that can be passed to determine the sort order? I didn't see one in the Wiki so I guess not - but I was hoping maybe there was some undocumented features :).

    It would also be nice to have some additional meta information about the albums returned here. Date for instance. That way I could at least sort on my end without having to do an individual call for each album returned.

    Thanks.
Sign In or Register to comment.