So now that you've uploaded images into a user's account, you'll probably want to view them. To do that, we'll need to dig down into the user's albums. So let's walk through that process using the album API.
First, you'll need either the email address of the user - which you probably have - or the encoded Shutterfly userid, which was returned as part of the create user process.
So if you want to use the user's email address, you can construct an resource path to GET that looks like this:
/user/santa@northpole.org/album
Alternatively, if you want to work with the userid:
/userid/9EcsnDRuyc/album
This request will return a listing of all of the albums for this user. You can look through those albums and get further details on a particular album with the id stored in the album entry, something like this:
/userid/9EcsnDRuyc/albumid/67b0de21e8d7570b35da
If you GET this resource, it will return information on the album, including the images contained within it. Of particular note is the media:group element. This group will have a couple media:content entries, which provide quick URL's to view the image within this album, in a couple of different sizes. You can also use the Image Request API for some basic functions on the image, including resizing and rotation.
Also, please note the media:group element at the feed level of this album. This describes the cover image for the album, which may be of interest to your application.
Limitations
- We are only supporting GET functions at this time. There is no way to create an album (outside of uploading into a new one) or editing an album or image currently.
-
The album API GET, as described above, may not return image entries in the future - we will be creating another level underneath
album to get image details, which will provide more flexibility and consistency. However, that does not exist yet, so the method of getting an image
above may become deprecated in the future. If you want to future-proof your application, you can do the following: append the parameter
"category-term=image" to the albumid request like this:
/userid/9EcsnDRuyc/albumid/67b0de21e8d7570b35da?category-term=imageThis will cause your application to always get the album in question plus all of its images, as it currently does, so you will not be affected by the coming change. Alternatively, you can send us an email at developerhelp@shutterfly.com and we'll advise you when we will be changing the API.