API Update - 18th November 2010
devbobo
Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
G'day Guys,
Tonight we shipped some new functionality for api version 1.2.2...
http://wiki.smugmug.net/display/API/API+1.2.2
Coupons
- Added album restrictions support for coupons.
- smugmug.coupons.create and smugmug.coupons.modify now appect an AlbumIDs parameter...a comma separated string of AlbumIDs to restrict the coupon to.
- also added smugmug.coupons.restrictions.albums.add and smugmug.coupons.restrictions.albums.remove to modify restrictions on an individual basis
- smugmug.coupons.get and smugmug.coupons.getInfo now return a Restrictions element if any restrictions exist.
BoutiquePackaging
- Added boutique packaging support to all album methods.
FeaturedAlbums
- Added smugmug.featured.albums.get
Cheers,
David
Tonight we shipped some new functionality for api version 1.2.2...
http://wiki.smugmug.net/display/API/API+1.2.2
Coupons
- Added album restrictions support for coupons.
- smugmug.coupons.create and smugmug.coupons.modify now appect an AlbumIDs parameter...a comma separated string of AlbumIDs to restrict the coupon to.
- also added smugmug.coupons.restrictions.albums.add and smugmug.coupons.restrictions.albums.remove to modify restrictions on an individual basis
- smugmug.coupons.get and smugmug.coupons.getInfo now return a Restrictions element if any restrictions exist.
BoutiquePackaging
- Added boutique packaging support to all album methods.
FeaturedAlbums
- Added smugmug.featured.albums.get
Cheers,
David
0
Comments
Any changes to just logging in? I cannot connect via API.
Getting a System.Xml.XmlException: Root element is missing on login.
"Know me through my lens."
My smugmug: http://peiklk.smugmug.com
My site: http://www.photographyvoice.com [POTD, Blog, News, & more!]
If your app is using an existing session, I suggest that you reset any SessionIDs or cookies that might be in use and obtain a new SessionID.
Cheers,
David
SmugMug API Developer
My Photos
Just tried again and getting "Root element is missing."
Code that's worked for many many months is now failing post-update.
"Know me through my lens."
My smugmug: http://peiklk.smugmug.com
My site: http://www.photographyvoice.com [POTD, Blog, News, & more!]
JSON: {
"message": "invalid user",
"method": "smugmug.albums.get",
"stat": "fail",
"code": 4
}
This is with accounts that were working before the API upgrade.
Can we get this fixed?
Thanks,
Brian
Login returns:
JSON: {
"Login": {
"User": {
"URL": "http:\/\/photos.snapwoodstudios.com",
"DisplayName": "radian09",
"id": 111111,
"NickName": "radian09"
},
"AccountStatus": "Active",
"PasswordHash": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"SmugVault": false,
"Session": {
"id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
"FileSizeLimit": 25165824,
"AccountType": "Pro"
},
"method": "smugmug.login.withPassword",
"stat": "ok"
}
Get albums returns:
JSON: {
"message": "invalid user",
"method": "smugmug.albums.get",
"stat": "fail",
"code": 4
}
Developers who are experiencing issues are most likely not calling login methods over https. I'm working on a new release that will throw the correct error message.
Cheers,
David
SmugMug API Developer
My Photos
https://api.smugmug.com/services/api/json/1.2.2/?method=smugmug.login.withPassword&EmailAddress=myaddress%40gmail.com&Password=mypassword&APIKey=myapikey
JSON: {
"Login": {
"User": {
"URL": "http:\/\/photos.snapwoodstudios.com",
"DisplayName": "radian09",
"id": 567279,
"NickName": "radian09"
},
"AccountStatus": "Active",
"PasswordHash": "xxxxxxxxxxxxxxxxxxxxxxxx",
"SmugVault": false,
"Session": {
"id": "xxxxxxxxxxxxxxx"
},
"FileSizeLimit": 25165824,
"AccountType": "Pro"
},
"method": "smugmug.login.withPassword",
"stat": "ok"
}
https://api.smugmug.com/services/api/json/1.2.2/?method=smugmug.albums.get&Empty=true&Extras=ImageCount,LastUpdated,Public,Highlight,Description,Keywords,URL&SessionID=xxxxxxxxxxxxxxxxx
JSON: {
"message": "invalid user",
"method": "smugmug.albums.get",
"stat": "fail",
"code": 4
}
https://secure.smugmug.com/services/api/json/1.2.2/
That's it, right there! I was using HTTP Login in my iPhone app.... My iPhone app is now broken. I need to update to HTTPS and re-submit it.... it's gonna take a week until it's on the App Store again...
Is that by any chance possible to keep the HTTP login method enabled for another week or so, so that developers have time to re-submit their app to Apple ? Would be amazing!
Thanks,
Greg.
it might not be the cause of your issue, but I can guarantee that numerous apps are currently failing for that reason.
I'm currently investigating your problem, I need to reproduce internally before I can work out what is going on.
SmugMug API Developer
My Photos
Thanks,
Brian
Hey Greg,
I'd love to help out...but the recent changes were in relation to side jacking exploits. And I think I'd have a tough time getting the changes rolled back.
Sorry,
David
SmugMug API Developer
My Photos
I'm curious, what IS a side jacking exploit?
just google side jacking or firesheep.
SmugMug API Developer
My Photos
I've reproduced the issue internally and have tracked down where the problem is...but I need to get more info on the recent underlying changes and that person is currently asleep.
One workaround is to only request login methods over https, and make all other calls over http.
Hope this helps a little bit.
Cheers,
David
SmugMug API Developer
My Photos
- calls to smugmug.login.* need to be done over https
- all other calls should be done over http (temporary workaround)
Cheers,
David
SmugMug API Developer
My Photos
Just tried it again and it worked... Still using http
"Know me through my lens."
My smugmug: http://peiklk.smugmug.com
My site: http://www.photographyvoice.com [POTD, Blog, News, & more!]
That is temporary so that apps aren't busted right now... you will need to use https, more details will be forthcoming from Devbobo, thanks.
Portfolio • Workshops • Facebook • Twitter
Thanks,
Brian
Let me know if you have any questions.
Cheers,
David
SmugMug API Developer
My Photos
Is this over anonymous session ? Only sessions created using smugmug.login.withPassword or smugmug.login.withHash will return the _su cookie...and only sessions created with those methods require it for subsequent https calls.
SmugMug API Developer
My Photos
This was a withHash login. I'll give it another try.
Side note, I just remembered why I'm using 1.2.1: I have no idea how to make 1.2.2 work! My login attempt returns 17:
https://api.smugmug.com/services/api/json/1.2.2/?method=smugmug.login.withHash&APIKey=xxxxxxxxxxxxxxx&PasswordHash=xxxxxxxxxxxxxxxxxxxx&UserID=xxxxxxxxxx
If I change to 1.2.1, it works fine. (The login, anyway; everything else is broken as mentioned earlier.) So, question #2, I guess, is "What should my 1.2.2 loginwithhash url look like? Sorry if I'm hijacking this thread, I will move the discussion if need be.
Thanks,
Andrew
Looks like there is an issue with the login.withHash method. I'll look into it today.
Cheers,
David
SmugMug API Developer
My Photos
The _su is not sent in this case.
My Photos | [highlight]SmugLoader[/highlight] | [highlight]Facebook[/highlight] | [highlight]Twitter[/highlight]