API Update - 27th January 2010

devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
G'day Guys,

To support the release of dynamic galleries, there have been a few api modifications.

Method calls smugmug.images.get (with Heavy) and smugmug.images.getInfo for version 1.2.0, 1.2.1, 1.2.2 now return...
- Type, indicates the type of image. possible values are.. Album, Collected or Smart
- Album object, pointing to the originating album (Collected or Smart only)
- User object, point to the originating owner (Collected or Smart only)

For API 1.2.2, you can request this new content without a Heavy call by requesting Extra=Origin,Type with smugmug.images.get.

At this point, there are no methods for defining/retrieving smart rules or collecting images from other galleries via the API, but these should be arriving over the next few weeks.

There are also the following modifications to API 1.2.2...
New methods...
- smugmug.albums.comments.get
- smugmug.images.comments.get
- smugmug.users.getInfo (which replaces smugmug.users.getDisplayName, although it's still callable)
- smugmug.service.ping
- smugmug.users.getStats
- smugmug.albums.getStats
- smugmug.images.getStats

Changes...
- smugmug.categories.get, smugmug.subcategories.get, smugmug.albums.get, smugmug.albums.getInfo and smugmug.users.getTree now return NiceNames
- smugmug.categories.get now returns Type to determine if it's a SmugMug or user defined category
- smugmug.login.withPassword, smugmug.login.withHash, smugmug.auth.getAccessToken and smugmug.auth.checkAccessToken now returns URL to the user's homepage.
- a number of methods (like smugmug.albums.create) now have an Extras parameter so the response can be customised, check the documentation for the specific methods.

Let me know if you run into any issues.

Cheers,

David
David Parry
SmugMug API Developer
My Photos

Comments

  • hoffmcshoffmcs Registered Users Posts: 125 Major grins
    edited January 27, 2010
    Thanks for the update to the API. I was just about to ask the question and the answer ways already there.

    So album type has no bearing on how albums and images are retrieved?
  • hoffmcshoffmcs Registered Users Posts: 125 Major grins
    edited January 27, 2010
    BTW, great updates to the API (as well as the great site features). The additions are a nice improvement! Thanks.
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited January 27, 2010
    hoffmcs wrote:
    So album type has no bearing on how albums and images are retrieved?

    All the images whether they be Album, Collected or Smart are returned by the same call smugmug.images.get.

    And albums can contain all types of images in the same album.

    Hope that make sense.

    Let me know if you have any other questions.

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • hoffmcshoffmcs Registered Users Posts: 125 Major grins
    edited January 27, 2010
    devbobo wrote:
    All the images whether they be Album, Collected or Smart are returned by the same call smugmug.images.get.

    And albums can contain all types of images in the same album.

    Hope that make sense.

    Let me know if you have any other questions.

    Cheers,

    David
    Yup, makes sense.

    I just found error definitions in the documentation! Dreamy!!
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited January 27, 2010
    hoffmcs wrote:
    I just found error definitions in the documentation! Dreamy!!

    The error stuff isn't fully implemented in all functions yet, will be soon hopefully.
    David Parry
    SmugMug API Developer
    My Photos
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited January 27, 2010
    bump...forgot to mention the stat methods in the original post.
    David Parry
    SmugMug API Developer
    My Photos
  • David PLDavid PL Registered Users Posts: 80 Big grins
    edited January 29, 2010
    devbobo wrote:
    bump...forgot to mention the stat methods in the original post.

    Nice. It looks like the new Stats methods return the image level stats for at least the past full year (I didn't try to go back any further than that).

    The new API functionality looks good. For the smugmug.albums.comments.get, it would be nice to have a Heavy option that would also return all the image level comments for the album.
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited January 29, 2010
    David PL wrote:
    Nice. It looks like the new Stats methods return the image level stats for at least the past full year (I didn't try to go back any further than that).

    The new API functionality looks good. For the smugmug.albums.comments.get, it would be nice to have a Heavy option that would also return all the image level comments for the album.

    To get comments from smugmug.images.get add Comments to the Extras parameter.

    &Extras=Comments
    David Parry
    SmugMug API Developer
    My Photos
  • arniwakarniwak Registered Users Posts: 2 Beginner grinner
    edited January 30, 2010
    Nice updates but somehow it seems like smugmug.albums.getInfo does not return categories and subcategories anymore.
    Is it part of the changes?
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited January 30, 2010
    arniwak wrote:
    Nice updates but somehow it seems like smugmug.albums.getInfo does not return categories and subcategories anymore.
    Is it part of the changes?

    that's not intentional, I'll check.

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited January 30, 2010
    arniwak wrote:
    Nice updates but somehow it seems like smugmug.albums.getInfo does not return categories and subcategories anymore.
    Is it part of the changes?

    fixed internally, it should go live some time this week.

    Thanks,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • David PLDavid PL Registered Users Posts: 80 Big grins
    edited January 31, 2010
    devbobo wrote:
    To get comments from smugmug.images.get add Comments to the Extras parameter.

    &Extras=Comments

    Great. Thanks!
  • BeachBillBeachBill Registered Users Posts: 1,311 Major grins
    edited January 31, 2010
    devbobo wrote:
    - a number of methods (like smugmug.albums.create) now have an Extras parameter so the response can be customised

    SWEET! thumb.gif

    I'm using this to streamline code by removing extra API calls and/or "Heavy" to give me just the info I need in one call with less bandwidth.

    clap.gifclapclap.gif
    Bill Gerrard Photography - Facebook - Interview - SmugRoom: Useful Tools for SmugMug
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited February 3, 2010
    arniwak wrote:
    Nice updates but somehow it seems like smugmug.albums.getInfo does not return categories and subcategories anymore.
    Is it part of the changes?

    this fix is live now
    David Parry
    SmugMug API Developer
    My Photos
  • DianogaDianoga Registered Users Posts: 2 Beginner grinner
    edited February 24, 2010
    Not sure if it is related to the update, but categories.delete is constantly giving me an error 16: invalid data. This is using both a new php API script as well as one which worked previously.
  • udyudy Registered Users Posts: 139 Major grins
    edited February 24, 2010
    Dianoga wrote:
    Not sure if it is related to the update, but categories.delete is constantly giving me an error 16: invalid data. This is using both a new php API script as well as one which worked previously.

    I've got the same in java.

    I've also got an "invalid PrintVendor parameter" error when I've been trying to create new Album. Is that new?

    I'm using v1.2.2 of the API.
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited February 24, 2010
    udy wrote:
    I've got the same in java.

    I've also got an "invalid PrintVendor parameter" error when I've been trying to create new Album. Is that new?

    I'm using v1.2.2 of the API.

    are you actually sending PrintVendor ? If so, what are you setting it to ?
    David Parry
    SmugMug API Developer
    My Photos
  • udyudy Registered Users Posts: 139 Major grins
    edited February 25, 2010
    devbobo wrote:
    are you actually sending PrintVendor ? If so, what are you setting it to ?

    Nope. I've just checked the generated map of parameters.

    That's why I'm asking. It is very odd, since that part of my code worked.

    I've also retested my code with the version 1.2.1 of the SM API, and it worked. So there could be an new issue in v1.2.2
  • udyudy Registered Users Posts: 139 Major grins
    edited February 25, 2010
    devbobo wrote:
    are you actually sending PrintVendor ? If so, what are you setting it to ?

    I think I can say that the issue is related to the Strict Error Handling parameter being true, in v1.2.2. When I put it to false, the album gets created.
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited February 25, 2010
    both issues are fixed internally.

    Thanks guys thumb.gif
    David Parry
    SmugMug API Developer
    My Photos
  • udyudy Registered Users Posts: 139 Major grins
    edited February 25, 2010
    devbobo wrote:
    both issues are fixed internally.

    Thanks guys thumb.gif

    You are welcome!

    I've sent you some private emails. Will you have time to reply? :D

    Claudiu
  • udyudy Registered Users Posts: 139 Major grins
    edited February 25, 2010
    What does it mean when the server returns


    smugmug.subcategories.create



    when the subcategory I want to create already exists?

    In the case of a category, not subcategory, the server returns an error


    smugmug.categories.create



    Is that a bug (in the case of subcategory)?
  • udyudy Registered Users Posts: 139 Major grins
    edited March 1, 2010
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited March 1, 2010
    udy wrote:
    Anybody?

    Hey Claudiu,

    It's on my list to look at...the issue is more deep seeded than the API itself, so I have a work around I might put in place while I investigate.

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited March 6, 2010
    Bug fixes are live now
    David Parry
    SmugMug API Developer
    My Photos
  • LighonTamerLighonTamer Registered Users Posts: 1 Beginner grinner
    edited May 11, 2011
    devbobo wrote: »
    Bug fixes are live now

    Is this in relation to the invalid data (catExists) error? I'm receiving it with gallery2smugmug.
Sign In or Register to comment.