smugmug.images.get on 1.2.2
David PL
Registered Users Posts: 80 Big grins
Hello,
I am working on moving from 1.2.0 to 1.2.2 and I am having some problems with smugmug.images.get with the Heavy flag on 1.2.2. This method has been working perfectly with 1.2.0, but I would like to move to 1.2.2 to take advantage of the new LastUpdated filter parameter. I am having the following problems:
1) If the account holder is using a custom domain, the image URLs that are returned are based on the custom domain instead of the [nickname].smugmug.com URL. This would be fine except that downloading using the custom domain URLs doesn't seem to work as it should on an authenticated session. Specifically, even with passing the SMSESS=[activesessionid] in the request header, downloading a non-publicly available image fails using the custom domain URLs.
2) The 1.2.2 API response when using Heavy no longer includes the AlbumURL for each image. I saw that if you add the Extras=AlbumURL to the 1.2.2 request, it will return the URL in an Album struct, but would expect it to be returned automatically with Heavy. Also, I noticed that when you use the Extras=AlbumURL, the response structure in 1.2.2 seems somewhat redundant. Specifically, without the Extras=AlbumURL parameter, the response looks like:
I am working on moving from 1.2.0 to 1.2.2 and I am having some problems with smugmug.images.get with the Heavy flag on 1.2.2. This method has been working perfectly with 1.2.0, but I would like to move to 1.2.2 to take advantage of the new LastUpdated filter parameter. I am having the following problems:
1) If the account holder is using a custom domain, the image URLs that are returned are based on the custom domain instead of the [nickname].smugmug.com URL. This would be fine except that downloading using the custom domain URLs doesn't seem to work as it should on an authenticated session. Specifically, even with passing the SMSESS=[activesessionid] in the request header, downloading a non-publicly available image fails using the custom domain URLs.
2) The 1.2.2 API response when using Heavy no longer includes the AlbumURL for each image. I saw that if you add the Extras=AlbumURL to the 1.2.2 request, it will return the URL in an Album struct, but would expect it to be returned automatically with Heavy. Also, I noticed that when you use the Extras=AlbumURL, the response structure in 1.2.2 seems somewhat redundant. Specifically, without the Extras=AlbumURL parameter, the response looks like:
- Album struct
- Images array
- Image struct
- Images array
- Album struct
- Images array
- Image struct
- Album struct
- Image struct
- Images array
- Images array
- Image struct
- Album struct
- Image struct
0
Comments
In order to support LastUpdated on smugmug.images.get, I needed to add an ImageCount at the root level and couldn't do that without adding the album element.
I realise that I am missing a URL element within the top level album element, which would resolve your problem... as you could manually construct the AlbumURL for each image using AlbumURL#ImageID_ImageKey.
I'll look at the custom domain issue, and potentially add a parameter to force to smugmug urls.
Cheers,
David
SmugMug API Developer
My Photos
actually, if you send &Sandboxed=1 all urls will be returned from photos.smugmug.com instead of the custom domain (or nickname.smugmug.com)..I assume that should work for you.
Cheers,
David
SmugMug API Developer
My Photos
Perfect. Thanks for the quick response
Would it be possible just to put the ImageCount as part of the Images element? For REST, the response could look something like:
...<method>smugmug.images.get</method>
<Images ImageCount="25">
<Image id="##"...>
...
<Image id="##"...>
</Images>
...
Or would that only work for REST and not for the other response types (JSON, etc) since I'm sure you would like to keep the response structures similar regardless of the response type? Obviously, I'm using REST.
I noticed that Flickr's API (e.g., flickr.photos.getRecent) seems to put the returned counts in the response similar to the example above.
SmugMug API Developer
My Photos
I understand. Easy enough to parse the response as it is. Thanks.