flyingdutchie
Nov-27-2007, 07:47 PM
Using Smugmug API 1.2.0, i've been trying to figure out how to detect when a call to a smugmug api function fails because the object is deleted (e.g. album.rename fails because the albumID is not/no longer valid). When specifying an invalid ID, the smugmug response returns an error:
Through the rename function:
Categories:
Code = 4: Invalid user
SubCategories:
Code = 4: Invalid user
Albums:
Through the changeSettings function:
Code = 5: system error or Code = 4: invalid user
Code is 5: when accessing previously deleted album
Code is 4: when accessing album that does not exist and never did.
Through the getInfo function
when referring to previously deleted album: I get the deleted album back! :scratch
Code = 5: (system error) when accessing album that does not exist and never did
Images:
to-do, for a little later.
Question:
Is it possible to detect if an item (image, album, category, etc...) is not valid on Smugmug, i.e. its ID is not known or has been deleted? The smugmug API responses are not very clear on this ('invalid user' or 'system error' could mean that the object still exists, but something else is wrong).
I ask this, because my SmugFig API has a simple caching mechanism and being able to figure out wether an object is valid on the Smugmug system/server itself is crucial. I could do a 'get' function, but this may be expensive and may not work for images (images.get require an AlbumID parameter; image could have moved and still exist).
Through the rename function:
Categories:
Code = 4: Invalid user
SubCategories:
Code = 4: Invalid user
Albums:
Through the changeSettings function:
Code = 5: system error or Code = 4: invalid user
Code is 5: when accessing previously deleted album
Code is 4: when accessing album that does not exist and never did.
Through the getInfo function
when referring to previously deleted album: I get the deleted album back! :scratch
Code = 5: (system error) when accessing album that does not exist and never did
Images:
to-do, for a little later.
Question:
Is it possible to detect if an item (image, album, category, etc...) is not valid on Smugmug, i.e. its ID is not known or has been deleted? The smugmug API responses are not very clear on this ('invalid user' or 'system error' could mean that the object still exists, but something else is wrong).
I ask this, because my SmugFig API has a simple caching mechanism and being able to figure out wether an object is valid on the Smugmug system/server itself is crucial. I could do a 'get' function, but this may be expensive and may not work for images (images.get require an AlbumID parameter; image could have moved and still exist).