Some problems with REST 1.1.1 API
mhilbush
Registered Users Posts: 70 Big grins
I posted these problems to the api-discussion mail list, but it's an understatement to say that the mail list is not very active. :dunno
#1) The REST 1.1.1 subcategory create API returns an "Invalid User" error when I try to create a subcategory under one of the standard Smugmug categories. The subcat create API DOES work correctly when you create the subcat under a user-defined category.
#2) I'm also struggling with the "heavy" response to smugmug.albums.get, as the category and subcategory IDs are no longer returned in the REST 1.1.1 response. Example below. You also can see that the structure of the category & subcategory tags are different...
<Album id="1904762">
<Highlight id="0"/>
<SubCategory>Georgetown Womens Lacrosse 2006</SubCategory>
<Community id="0"/>
<Position>7</Position>
<ImageCount>62</ImageCount>
<Title>Georgetown Annual Alumni Lacrosse Game</Title>
<Description/>
<Keywords/>
<Public>1</Public>
<Password/>
<PasswordHint/>
<Printable>1</Printable>
<Filenames>1</Filenames>
<Comments>1</Comments>
<External>1</External>
<Originals>1</Originals>
<EXIF>0</EXIF>
<Share>0</Share>
<SortMethod>FileName</SortMethod>
<SortDirection>0</SortDirection>
<LastUpdated>2006-09-23 11:16:22</LastUpdated>
<FamilyEdit>1</FamilyEdit>
<FriendEdit>1</FriendEdit>
<HideOwner>0</HideOwner>
<CanRank>0</CanRank>
<Larges>1</Larges>
<Clean>1</Clean>
<Protected>0</Protected>
<Watermark id=""/>
<DefaultColor>0</DefaultColor>
<ProofDays>0</ProofDays>
<Backprinting/>
<Header>0</Header>
<Template id="0"/>
<Category id="">
<Title>College Sports</Title>
</Category>
</Album>
Thanks for any help. These two problems are delaying my ability to move to the 1.1.1 API.
Thanks,
Mark
#1) The REST 1.1.1 subcategory create API returns an "Invalid User" error when I try to create a subcategory under one of the standard Smugmug categories. The subcat create API DOES work correctly when you create the subcat under a user-defined category.
#2) I'm also struggling with the "heavy" response to smugmug.albums.get, as the category and subcategory IDs are no longer returned in the REST 1.1.1 response. Example below. You also can see that the structure of the category & subcategory tags are different...
<Album id="1904762">
<Highlight id="0"/>
<SubCategory>Georgetown Womens Lacrosse 2006</SubCategory>
<Community id="0"/>
<Position>7</Position>
<ImageCount>62</ImageCount>
<Title>Georgetown Annual Alumni Lacrosse Game</Title>
<Description/>
<Keywords/>
<Public>1</Public>
<Password/>
<PasswordHint/>
<Printable>1</Printable>
<Filenames>1</Filenames>
<Comments>1</Comments>
<External>1</External>
<Originals>1</Originals>
<EXIF>0</EXIF>
<Share>0</Share>
<SortMethod>FileName</SortMethod>
<SortDirection>0</SortDirection>
<LastUpdated>2006-09-23 11:16:22</LastUpdated>
<FamilyEdit>1</FamilyEdit>
<FriendEdit>1</FriendEdit>
<HideOwner>0</HideOwner>
<CanRank>0</CanRank>
<Larges>1</Larges>
<Clean>1</Clean>
<Protected>0</Protected>
<Watermark id=""/>
<DefaultColor>0</DefaultColor>
<ProofDays>0</ProofDays>
<Backprinting/>
<Header>0</Header>
<Template id="0"/>
<Category id="">
<Title>College Sports</Title>
</Category>
</Album>
Thanks for any help. These two problems are delaying my ability to move to the 1.1.1 API.
Thanks,
Mark
Mark
0
Comments
Sorry about the delay with getting back to you. I was actually looking at both of these issues yesterday. I am in the process of getting a list of issues together for Don to have a look at...and both will be on that list.
I was going to suggest that you take a look at the new response structure in version 1.2.0, as it is different to 1.1.1, but a lot easier to parse imo. But that's not going to help you much since there seems to be a bug with smugmug.albums.get with Heavy using REST, that doesn't seem to exist with JSON or PHP.
Cheers,
David
SmugMug API Developer
My Photos
I'll take a look at 1.2.0. Do you know the timeframe for when 1.2.0 will be a full production release?
Mark
Hey Mark,
With Christmas it's a bit hard to tell, it depends on how much time I can get with Don to sort out the issues.
Hopefully it would be that long, Don and I are keen to get the existing functionality bedded down, so we can start on some new API development.
Cheers,
David
SmugMug API Developer
My Photos
As for new API development, I'm still interested in a search API. This would open some doors for extensions to my IMatch/Smugmug tools. It would sure be nice to select an image in IMatch, then query Smugmug to see if the image is already on Smugmug and, if so, in which album(s). Just consider this a shameless plug for a search API in 1.2.0.
Thanks for all your help. I really appreciate the investment of time you're making in the API.
Mark
I'm a relative newbie on Smugmug, but I've been using Imatch for several years.
I'm looking into automating my Imatch database and smugmug galleries, so I'll be using and/or modifying Mark's (mhilbush) smuguploader and smugsync scripts.
I guess my first question is protocol. Since this is based on Mark's scripts should I go on using his API key, or should I get my own (If I bring smugmug to its knees I don't want him to be the fall guy!)
af-photos.smugmug.com
My password had a '+' in it.
The fragment of javascript code is:
req.Open "GET", url, False
req.SetRequestHeader( "Connection", "Close" )
req.Send
The url is (password EDITED )
URL=https://api.smugmug.com/hack/rest/?method=smugmug.login.withPassword&EmailAddress=MYEMAIL@MYWEB.com&Password=ABCD+1234&Version=1.1.0&APIKey=MHILSONS_APIKEY
This returns 'fail' for the password.
I removed the '+' from the password and I can get 'ok'.
Should I put quotes (Single? Double?) around the password string in the URL ?
af-photos.smugmug.com
The code snippet is Sax Basic (VBasic) of course.
af-photos.smugmug.com
Hi af-photos,
You need to url-encode your parameters so that this doesn't happen.
If you need any help, let me know.
Cheers,
David
SmugMug API Developer
My Photos
I just registered for my own API keys, so I guess you'll be seing a bit more of me around here!
I use Imatch for image classification, so I'm looking into ways of integrating smugmug into my workflow.
However, I'm finding Imatch's Sax Visual Basic interface a bit limiting (for instance, you can't make a tabbed dialog), so I'm thinking of other options.
af-photos.smugmug.com