API 1.2.2 (soft release)
devbobo
Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
G'day All,
I am in the processing of implementing OAuth for the API. The first stage of the process was to refactor the API to make it possible to implement OAuth, as part of these changes I have done a lot of optimisation and implemented a few features that people having been asking for. So I am rolling this version out as a soft release, the released and beta api versions aren't going to change at this point as there is still quite a bit of work to complete the OAuth implementation.
Here's a list of changes in no particular order...
Cheers,
David
I am in the processing of implementing OAuth for the API. The first stage of the process was to refactor the API to make it possible to implement OAuth, as part of these changes I have done a lot of optimisation and implemented a few features that people having been asking for. So I am rolling this version out as a soft release, the released and beta api versions aren't going to change at this point as there is still quite a bit of work to complete the OAuth implementation.
Here's a list of changes in no particular order...
- Pretty mode: Adding &Pretty=1 to the request returns readable json responses.
- Boolean parameters: Boolean parameters can now be sent as either 0|1 or true|false.
- Strict mode: A number of people complained about calls like smugmug.albums.get returning an error response when there are no albums. By default now, empty elements (albums, images, subcats, watermarks, etc) are returned. To invoke an error like previously, add &Strict=1 to the request. This feature also works for methods like smugmug.albums.changeSettings where saving the same parameters resulted in an error.
- ThemeID: ThemeID can now be set for smugmug.albums.create and smugmug.albums.changeSettings, and is returned by smugmug.albums.getInfo and smugmug.albums.get with Heavy=1.
- Build your own heavy response: I have had a ton of requests by different people to add different bits and pieces to the standard non-heavy response for methods like smugmug.albums.get, smugmug.users.getTree or smugmug.images.get. I have added a new feature that lets you build your own heavy response and only return the info you want. To do this add &Extras to your requests and then comma-seperate the additional parameters you want returned.
eg. ....method=smugmug.albums.get&Extras=LastUpdated,Geography
- Previously, a number of parameters returned by smugmug.images.getInfo or smugmug.albums.getInfo were returned only for the owner scope. However, a number of these parameters were able to be determined by a logged out user of the site. As a result, what is returned now by those methods is more in line with what is available on the site.
- XML-RPC requests: All XML-RPC requests need to be sent as structs for api version 1.2.2 onwards. Altenatively, I have implemented it so that XML-RPC works with a standard GET request like the other API types. eg. http://api.smugmug.com/services/api/xmlrpc/1.2.2/?method=smugmug.albums.get&SessionID=xxxx
- Stats methods: I haven't had a chance to rewrite the Stats methods yet, so they currenly return "System Error (Not Implemented yet)".
- Image/Album Key: This version of the API has the stage 3 security features implemented.
Cheers,
David
0
Comments
Wow, this is a real improvment! I can't wait (and won't) to start testing this!
This sounds great. Thanks for implementing our requests.
Does version 1.2.2 also have all of the methods listed in the 1.2.1 wiki implemented?: http://wiki.smugmug.com/display/SmugMug/1.2.1
Thanks for all your work on this
David,
yes, except for all the communitiy methods (i believe)
SmugMug API Developer
My Photos
Great! These new features and flexibility are a nice improvement. Thanks!
Shan
Hi!
The smugmug.friend.get method returns this:
{"stat":"fail","code":3,"message":"invalid session"}
after this request (JSON):
method=smugmug.friends.get&SessionID=
The sessionID is just fine as I can add a friend w/o a hitch.
(using the 1.2.2 endpoint)
&&
In the watermark struct returned by watermarks.get the variable dissolve is returned as a string, maybe it should be returned as an int?
(JSON 1.2.2)
&&
The dgrinn documentation for watermak.create is wrong. int Dissolved should be int Dissolve
/Adam
yes
SmugMug API Developer
My Photos
fix internally
yes, fixed internally
changed
Thanks
SmugMug API Developer
My Photos
Ok, here goes:
Sharegroups.getInfo, create, results in "The remote server returned an error: (500) Internal Server Error"
Alsos theres a "waterwark" typo in smugmug.images.removeWaterwark
/Adam
fixed (internally) and fixed
SmugMug API Developer
My Photos
SmugMug API Developer
My Photos
David
Twitter: @WolfSnap
Facebook: http://www.facebook.com/WolfSnapDesigns
SmugMug & Wordpress Customization - WolfSnap.com | Custom Domains
call smugmug.themes.get
SmugMug API Developer
My Photos
Sweet!
Ok...
Here goes!
smugmug.propricing.getPortfolio getAlbum, getImage w/o any optionals works just fine, but with a call like this:
"method=smugmug.propricing.getPortfolio&SessionID=e0d0da5a0bf9808fcc2ffb995392030a&ProductType=[\"CommonPrint\",\"Merchandise\",\"Download\"]"
you get an answer like this:
"{\"stat\":\"ok\",\"method\":\"smugmug.propricing.getPortfolio\"}" which is not as bad as an internal 500 but not quite as good as an array of products...
If you call it like this:
"method=smugmug.propricing.getPortfolio&SessionID=e0d0da5a0bf9808fcc2ffb995392030a&ProductID=[10040,10043,10048]"
or like this:
method=smugmug.propricing.getPortfolio&SessionID=e0d0da5a0bf9808fcc2ffb995392030a&ProductType=[\"CommonPrint\",\"Merchandise\",\"Download\"]&ProductID=[10040,10043,10048]""
you get this:
{\"stat\":\"fail\",\"code\":16,\"message\":\"invalid data (no custom portfolio pricing set)\"}"
Which is not true...
Also a question.
The logout method returns an error when trying to logout a anonymous session. I understand the logic behind that but isn't actually good manners to tell the server that a session is to be considred expired instead of waiting for the session to timeout and die?
it does actually work, but you need to call it like this....
method=smugmug.propricing.getPortfolio&SessionID=e0d0da5a0bf9808fcc2ffb995392030a&ProductType[]=CommonPrint&ProductType[]=Merchandise&ProductType[]=Downloads&ProductID[]=10040&ProductID[]=10043&ProductID[]=10048
SmugMug API Developer
My Photos
Ok! Are you going to fix it to be more JSON-like, or is this how it should look?
/Adam
I've just noticed that the 1.2.2 albums.get() for anonymous calls don't return the same information as say earlier revs, eg 1.2.1.
I'm using the PHP endpoint.
eg. 1.2.1 anonymous albums.get(Heavy=FALSE):
eg. 1.2.2 anonymous albums.get(Heavy=FALSE):
In fact, even using Heavy=TRUE doesn't return the album Title when logged in anonymously.
I've not tested any other methods yet, but as soon as I notice more diffs, I'll let you know.
Personal Blog | Tech Blog | phpSmug
something odd there...i'll check it out.
SmugMug API Developer
My Photos
Trying to find the API documentation in the Wiki, and it seems to be missing.
le pere de www.nikiwalkerphotography.com
http://wiki.smugmug.com/display/API/API+1.2.2
That's interesting, and it certainly does take you to the 1.2.2 API, but from the main Wiki page at
http://wiki.smugmug.com/display/SmugMug/Home
there does not seem to be any way to get to the API documentation. It looks like it may be broken.
le pere de www.nikiwalkerphotography.com
Yeah, Mr. devbobo is working on the new API documentation, along with the new API itself, amongst other things. I'm sure he'll fix it as soon as he can
I only provided the 1.2.2 docs since this is a 1.2.2 thread. The other docs are also easily found if you use the search box.
someone pwned some of our wiki pages. Should be working again now.
SmugMug API Developer
My Photos
Now when I click API from
http://wiki.smugmug.net/display/SmugMug/Home
it does seem to take me to the API wiki,
but the "General information, tutorials, documentation and more!" link still seems broken/confused.
Hope this helps.
And now the "General info..." link points to the API wiki also. Thanks for fixing.
le pere de www.nikiwalkerphotography.com
Is the 1.2.2 API going to implement the oauth_callback functionality at some time in the future?
It doesn't appear to right now and this would really help streamline the whole access/authorisation process for application developers.
Personal Blog | Tech Blog | phpSmug
Hey Colin,
In your control panel in the API Keys section, if you select 'change' you can set the oauth_callback_url. At this point, we aren't allowing the oauth_callback_url to be passed in authorize request.
Cheers,
David
SmugMug API Developer
My Photos
Personal Blog | Tech Blog | phpSmug
David
Twitter: @WolfSnap
Facebook: http://www.facebook.com/WolfSnapDesigns
SmugMug & Wordpress Customization - WolfSnap.com | Custom Domains
Hi David
Looks like watermarks.create no longer returns the watermark ID on success when using the PHP endpoint (I've not tested others):
1.2.1 Endpoint:
1.2.2. Endpoint:
Personal Blog | Tech Blog | phpSmug