API smugmug.users.getTree & APIs in general
mhilbush
Registered Users Posts: 70 Big grins
I am finding that this API does not return what I expect. For some reason, it returns the complete set of albums under each and every category, irrespective of whether those categories have subcategories and/or albums. Is this the correct behavior?
And, more generally, I realize the above api is in "beta", but it appears to have been in beta for quite some time. Are these apis undergoing active development and/or defect fixes?
BTW, I am working on a script to integrate my IMatch image management system with Smugmug.
Thanks,
Mark
[Edit] One clarification, it looks like it is including the albums from other categories only when those albums are directly under another category. If the albums are in other subcategories, they are not included.
And, more generally, I realize the above api is in "beta", but it appears to have been in beta for quite some time. Are these apis undergoing active development and/or defect fixes?
BTW, I am working on a script to integrate my IMatch image management system with Smugmug.
Thanks,
Mark
[Edit] One clarification, it looks like it is including the albums from other categories only when those albums are directly under another category. If the albums are in other subcategories, they are not included.
Mark
0
Comments
Unfortunately, I don't have much experience with this function. It was introduced after I had already written some code for building tree structures using different API calls.
Anyway, hopefully Don or someone else might drop by who has more experience with this call.
Cheers,
David
SmugMug API Developer
My Photos
http://www.chrislaudermilkphoto.com/
Yes, it certainly is your fault!
Since this API didn't work, I figured I try the create/delete category/subcategory APIs. Well, it looks like they don't work either.
What's up with these APIs? Are you supposed to find out which ones work and don't work by trial and error???
Mark
Mark,
I know that you're probably frustrated, but just saying it doesn't work really doesn't give someone anything to go by. How about posting the xml response that you are getting.
below is a list of SM functions that i know work fine from my own experience...
smugmug.login.withPassword
smugmug.login.withHash
smugmug.login.anonymously
smugmug.logout
smugmug.accounts.getType
smugmug.albums.get
smugmug.albums.getInfo
smugmug.albums.create
smugmug.albumtemplates.get
smugmug.images.get
smugmug.images.getURLs
smugmug.images.getInfo
smugmug.images.getEXIF
smugmug.categories.get
smugmug.subcategories.get
Cheers,
David
SmugMug API Developer
My Photos
Here:
http://www.dgrin.com/showthread.php?t=11401
And here:
http://www.dgrin.com/showthread.php?t=10982
Had I searched on the category & subcategory create APIs first, I might've saved myself some time. Lesson learned.
Yes, I've had good experience with some of the APIs, and that's great. In fact, I've used most of the ones you've listed with great success.
The reason I ask, if you really need the functionality for create/modify/delete category/subcategories....it is possible to reverse engineer the current web utilities as a means to an end.
Myself and Nikolai did this for a few features that didn't exist in the API at the time.
Just an idea
So what u working on ? And how did claudermilk get u into it ?
Cheers,
David
SmugMug API Developer
My Photos
http://www.chrislaudermilkphoto.com/
I'm working on a script to integrate my image management tool, IMatch, with Smugmug. Basically, I wanted a way to upload images from an IMatch category, folder, or selection result set into an album on Smugmug. I wanted the ability to use an existing album, or to create a new album based on an existing album template or on user-defined properties.
All the above functionality is working, so I was looking to add some more goodies, such as the ability to manage categories and subcategories. I also was toying with the idea of replicating the Smugmug category/subcategory/album tree as a category hierarchy in IMatch, which is where I ran into the issue with the getTree API.
Thanks for all your advice, devbobo. It's been very helpful.
I use the function smugmug.albums.get, it returns category/ category ID for each album along with subcategory/subcategory ID (where applicable).
I iterate the results and build a tree structure manually. It's a little bit tedious to write and debug...but the code still works.
Perhaps this is something you could try since smugmug.users.getTree isn't working.
Cheers,
David
SmugMug API Developer
My Photos
So I like keeping up on the tools I use. Ok, like it used to say at IMatch, I'm an addict... Seriously, take a look at my Dance galleries here, that should really explain it--I'm getting some recognition from local dancers & do a lot of shooting now "hey, I'm doing this show, you wanna photograph it?" "umm...duh?" (thus my db growing from 15k images to over 70k images in a year). Now that I have several technical issues resolved, I should be able to get caught up on postprocessing, then there's some play time available again--oh, and after October the hot rod build wil be complete freeing more time.
http://www.chrislaudermilkphoto.com/
Good suggestion, David. That approach will work just fine!
I also tried the POST implementation to create categories and subcategories -- works just fine. I found the category delete REST API to work fine, but the subcategory delete REST API seems to have problems, so that had to be handled just like create.
Perhaps someone from Smugmug can weigh in on when/if these broken APIs will get some attention.
Mark