Consistency among structures return by the API

chrispatchrispat Registered Users Posts: 7 Beginner grinner
I have been working with the API for awhile now and recently it has started to bother me that the structures that are returned are very in consistent.

For example, when I call getAlbumStats I get an Album Structure. When I call getAlbums or getAlbumInfo I also get an album structure. The problem is the Album structure from the stats method is completely different from the album structure from the get album methods. I have seen similar problems with the image apis and I am sure there are a few more.

To me this makes for a very confusing and difficult to work with API. Is there anyone else out there that sees this as an issue? Or is it only those of use who are working with typed languages (i.e. not javascript or PHP).

Thanks,
Chris

Comments

  • burnburn Registered Users Posts: 7 Beginner grinner
    edited April 25, 2008
    I'm in the process of moving from 1.1.1 to 1.2.0. I don't know why the returned structures would be changed for calls like smugmug.images.get but they are different and this requires a bunch of extra work.


    - Mark

    Sorry - the call I was looking at was smugmug.albums.get...
  • AdamNAdamN Registered Users Posts: 18 Big grins
    edited April 26, 2008
    From the top of my head, and I could be wrong eek7.gif, but I don't think that the structs differ. Some methods doesn't return a complete struct however. So if you where to use heavy you would get yet another struct. That one could be used as a blueprint for all other "sub-structs". Also move to 1.2.2 if you haven't already, a lot of qirks and bugs has been banished in that release!

    Best regards
    Adam
  • rkallarkalla Registered Users Posts: 108 Major grins
    edited April 26, 2008
    Guys,
    Adam is spot on. For the kallasoft SmugMug Java API I went through quite a few different ways of approaching this issue and discussing things with David, until with the Beta 3 release I was able to finally abstract out everything into the more common groupings... in my case, ini the form of entity classes.

    I don't know if this will help you guys out, but so far it's been working great, and these are the entities I found I needed to cover all of 1.2.0 and some of 1.2.1 so far:

    http://www.kallasoft.com/resources/smugmug_java_api/documentation/api/com/kallasoft/smugmug/api/json/entity/package-summary.html

    Hope that helps.
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited April 26, 2008
    Moving from 1.1.1 to 1.2.0 was a big change. This is due to adding PHP and JSON, the response formats needed to be modified so that they were the same across the board.
    David Parry
    SmugMug API Developer
    My Photos
Sign In or Register to comment.