Request for enhancement images.get method

flyingdutchieflyingdutchie Registered Users Posts: 1,286 Major grins
Hello Smugmug,

The 1.2.0 method images.get differs from all the other objects' get method that it needs an extra parameter to function: AlbumID. All the other objects' get methods don't need an extra 'search' criterium.

This is probably done to limit the size of the response from the images.get method.

It would be great if the AlbumID parameter were optional so that the images.get returns ALL images of the given owner.

Could this be done in 1.2.0 or in 1.2.1?

Thanks!
I can't grasp the notion of time.

When I hear the earth will melt into the sun,
in two billion years,
all I can think is:
    "Will that be on a Monday?"
==========================
http://www.streetsofboston.com
http://blog.antonspaans.com

Comments

  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited November 18, 2007
    Anton,

    I need to chat to Don about this, as it could potentially effect performance, due to some customers having in excess of 8000 albums and 100,000+ images.

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • flyingdutchieflyingdutchie Registered Users Posts: 1,286 Major grins
    edited November 19, 2007
    devbobo wrote:
    Anton,

    I need to chat to Don about this, as it could potentially effect performance, due to some customers having in excess of 8000 albums and 100,000+ images.

    Cheers,

    David

    Hi David,

    That's what i thought as well. :D A number 100,000+ images is a large download. Maybe it is possible to do large downloads in 'non-heavy' mode only: e.g. with AlbumID, the Heavy parameter can be set to both 0 and 1. Without an AlbumID, the Heavy parameter is ignored and implicitly set to 0 (non-heavy).

    Right now, if i want to get all images, i have to loop through all albums (1 request in above example) and then get all images from each album (8000 requests in above example). It works, i tried it :D , but i think that one large request is faster than 8000 smaller ones.

    -- Anton.
    I can't grasp the notion of time.

    When I hear the earth will melt into the sun,
    in two billion years,
    all I can think is:
        "Will that be on a Monday?"
    ==========================
    http://www.streetsofboston.com
    http://blog.antonspaans.com
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited November 19, 2007
    Dutchie,

    one thing I may be doing shortly, is allowing you to define multiple album ids on that method call.

    Something like this...

    smugmug.images.get&AlbumID[]=1234&AlbumID[]=4567&AlbumID=5555.

    Not sure when this is going to happen yet.

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • yoDonyoDon Registered Users Posts: 3 Beginner grinner
    edited November 25, 2007
    devbobo- You might take a look at how the Amazon S3 API handles listing the contents of a bucket. They add two optional parameters. The first is the maximum number of results to return in the call (which Amazon clamps at 1000). Specifying "0" for the number of results is a shorthand for the max number of results, but in no case will you receive more than 1000 results from a single call. To obtain the remaining results, you can specify the second optional parameter (which I believe they call the marker). If you provide a marker (typically the id of the last result received in the previous call), the API will return the next set of results starting immediately _after_ the marker. In this way you can easily walk through an arbitrarily long list while only interacting with result bundles of a manageable size. Providing a null or empty marker implies starting at the beginning.

    -Don
  • rkallarkalla Registered Users Posts: 108 Major grins
    edited November 25, 2007
    yoDon wrote:
    devbobo- You might take a look at how the Amazon S3 API handles listing the contents of a bucket. They add two optional parameters. The first is the maximum number of results to return in the call (which Amazon clamps at 1000). Specifying "0" for the number of results is a shorthand for the max number of results, but in no case will you receive more than 1000 results from a single call. To obtain the remaining results, you can specify the second optional parameter (which I believe they call the marker). If you provide a marker (typically the id of the last result received in the previous call), the API will return the next set of results starting immediately _after_ the marker. In this way you can easily walk through an arbitrarily long list while only interacting with result bundles of a manageable size. Providing a null or empty marker implies starting at the beginning.

    -Don

    Don that's a pretty good idea for a public API in general. Besides being a good tip for Smug API, I'm filing that away in my "good to know" part of my brain for future projects.

    Thanks for posting dude thumb.gif
Sign In or Register to comment.