Some problems with REST 1.1.1 API

mhilbushmhilbush 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
Mark

Comments

  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited December 9, 2006
    Hi Mark,

    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
    David Parry
    SmugMug API Developer
    My Photos
  • mhilbushmhilbush Registered Users Posts: 70 Big grins
    edited December 10, 2006
    Thanks, David.

    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
    Mark
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited December 10, 2006
    mhilbush wrote:
    Do you know the timeframe for when 1.2.0 will be a full production release?

    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
    David Parry
    SmugMug API Developer
    My Photos
  • mhilbushmhilbush Registered Users Posts: 70 Big grins
    edited December 11, 2006
    No problem, David. Just looking to get a guage on when 1.2.0 will be available to better help me determine how much time to spend on 1.1.1. If it'll be a while, I'll get my stuff to work with 1.1.1, then move on to 1.2.0 when it's ready. However, I'm kinda stuck right now, as I can't justify spending more time on 1.1.1 due to the problems mentioned above.

    As for new API development, I'm still interested in a search API. :D 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. rolleyes1.gif

    Thanks for all your help. I really appreciate the investment of time you're making in the API.

    Mark
    Mark
  • af-photosaf-photos Registered Users Posts: 56 Big grins
    edited May 1, 2007
    Another Imatch user
    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!)
    Alan :thumb
    af-photos.smugmug.com
  • af-photosaf-photos Registered Users Posts: 56 Big grins
    edited May 1, 2007
    Password with non-alphanumeric fails
    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 iloveyou.gif)
    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 ?
    Alan :thumb
    af-photos.smugmug.com
  • af-photosaf-photos Registered Users Posts: 56 Big grins
    edited May 1, 2007
    Imatch's Sax Basic (VBasic) not javascript
    The code snippet is Sax Basic (VBasic) of course.
    Alan :thumb
    af-photos.smugmug.com
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited May 1, 2007
    af-photos wrote:
    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 iloveyou.gif)
    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 ?

    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
    David Parry
    SmugMug API Developer
    My Photos
  • af-photosaf-photos Registered Users Posts: 56 Big grins
    edited May 3, 2007
    Got my own API key
    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.
    Alan :thumb
    af-photos.smugmug.com
Sign In or Register to comment.