• Gear
  • Shots
  • Photo Craft
  • Video
  • Wide Angle
  • Support
  • New Stuff
  • More
Support SmugMug APIs, Hacks & Tricks API 1.2.2 (soft release)

Need some help with your New SmugMug Site?

Dgrin Challenges

They're back! Our latest series of Dgrin Challenges, the OOYCZ Challenges (Out of Your Comfort Zone), is a series of challenges to help you improve your photography by stepping out of your comfort zone and trying something new. Our challenge leader says "Consider it like a photography class with no diplomas.". Get started with OOYCZ by reading the Challenge Guide.

Past DSS Challenge Winners, DSS Challenge Rules, and other important DSS Challenge information is here.

Looking for a little challenge? The Dgrin Mini-Challenges are a great way to challenge yourself. Take a moment to look through past winners and find the current Mini Challenge here.

From Around the Net

Enjoy a few of our favorite articles from around the 'net. If you have something you think we should see, post it here and we'll have a look.

Journeys

Landscapes

Sports

 
Thread Tools Display Modes
Page 1  of  4
1 2 3 4
Old Apr-11-2008, 08:42 PM
#1
devbobo is offline devbobo OP
LR whisperer
devbobo's Avatar
API 1.2.2 (soft release)
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...
  • 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,G eography
  • 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.
Caveats:
  • 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/...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.
I imagine there are going to be some bugs, just let me know.

Cheers,

David
__________________
David Parry
SmugMug API Developer
My Photos
Old Apr-12-2008, 03:16 AM
#2
AdamN is offline AdamN
Big grins
Niiice!!!
Wow, this is a real improvment! I can't wait (and won't) to start testing this!
Old Apr-12-2008, 06:41 AM
#3
David PL is offline David PL
Big grins
Quote:
Originally Posted by devbobo
G'day All,

<snip>

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.

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.

<snip>
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
Old Apr-12-2008, 01:56 PM
#4
devbobo is offline devbobo OP
LR whisperer
devbobo's Avatar
Quote:
Originally Posted by David PL
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)
__________________
David Parry
SmugMug API Developer
My Photos
Old Apr-12-2008, 11:46 PM
#5
dound is offline dound
David Underhill
dound's Avatar
Quote:
Originally Posted by devbobo
G'day All,
  • Boolean parameters
  • Strict mode
  • Build your own heavy response
Great! These new features and flexibility are a nice improvement. Thanks!
__________________
~ David Underhill
Old Apr-14-2008, 10:10 AM
#6
iotashan is offline iotashan
Big grins
iotashan's Avatar
Dumb question... pretty and strict... do they accept true/false and 1/0 ?

Shan
Old Apr-14-2008, 11:09 AM
#7
AdamN is offline AdamN
Big grins
Bugs...
Hi!
The smugmug.friend.get method returns this:
{"stat":"fail","code":3,"message":"invalid session"}

after this request (JSON):
method=smugmug.friends.get&SessionID=<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

Last edited by AdamN; Apr-14-2008 at 11:38 AM.
Old Apr-14-2008, 01:37 PM
#8
devbobo is offline devbobo OP
LR whisperer
devbobo's Avatar
Quote:
Originally Posted by iotashan
Dumb question... pretty and strict... do they accept true/false and 1/0 ?

Shan
yes
__________________
David Parry
SmugMug API Developer
My Photos
Old Apr-14-2008, 02:08 PM
#9
devbobo is offline devbobo OP
LR whisperer
devbobo's Avatar
Quote:
Originally Posted by AdamN
The smugmug.friend.get method returns this:
{"stat":"fail","code":3,"message":"invalid session"}
fix internally


Quote:
Originally Posted by AdamN
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)
yes, fixed internally

Quote:
Originally Posted by AdamN
The dgrinn documentation for watermak.create is wrong. int Dissolved should be int Dissolve
changed

Thanks
__________________
David Parry
SmugMug API Developer
My Photos
Old Apr-16-2008, 11:09 AM
#10
AdamN is offline AdamN
Big grins
Todays crop...
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
Old Apr-16-2008, 01:57 PM
#11
devbobo is offline devbobo OP
LR whisperer
devbobo's Avatar
Quote:
Originally Posted by AdamN
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
__________________
David Parry
SmugMug API Developer
My Photos
Old Apr-17-2008, 05:17 PM
#12
devbobo is offline devbobo OP
LR whisperer
devbobo's Avatar
the above bug fixes should be live now
__________________
David Parry
SmugMug API Developer
My Photos
Old Apr-17-2008, 10:03 PM
#13
DrDavid is offline DrDavid
Smugization Master
DrDavid's Avatar
Quote:
Originally Posted by devbobo
  • 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.
How do you determine what the themeID is for a particular theme?

David
__________________
Smugization Central (WolfSnap.com)
Twitter: @WolfSnap
Facebook: http://www.facebook.com/WolfSnapDesigns

SmugMug & Wordpress Customization - WolfSnap.com | Custom Domains
Old Apr-18-2008, 06:02 AM
#14
devbobo is offline devbobo OP
LR whisperer
devbobo's Avatar
Quote:
Originally Posted by DrDavid
How do you determine what the themeID is for a particular theme?

David
call smugmug.themes.get
__________________
David Parry
SmugMug API Developer
My Photos
Old Apr-18-2008, 10:33 AM
#15
AdamN is offline AdamN
Big grins
Quote:
Originally Posted by devbobo
the above bug fixes should be live now
Sweet!
Old Apr-18-2008, 12:16 PM
#16
AdamN is offline AdamN
Big grins
Another day, anoter bug to be squashed :-)
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=e 0d0da5a0bf9808fcc2ffb995392030a&ProductType=[\"CommonPrint\",\"Merchandise\",\"Download\"]&ProductID=[10040,10043,10048]""
you get this:
{\"stat\":\"fail\",\"code\":16,\"message\":\"inval id 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?

Last edited by AdamN; Apr-18-2008 at 12:42 PM.
Old Apr-18-2008, 02:28 PM
#17
devbobo is offline devbobo OP
LR whisperer
devbobo's Avatar
Quote:
Originally Posted by AdamN
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=e 0d0da5a0bf9808fcc2ffb995392030a&ProductType=[\"CommonPrint\",\"Merchandise\",\"Download\"]&ProductID=[10040,10043,10048]""
you get this:
{\"stat\":\"fail\",\"code\":16,\"message\":\"inval id 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=e 0d0da5a0bf9808fcc2ffb995392030a&ProductType[]=CommonPrint&ProductType[]=Merchandise&ProductType[]=Downloads&ProductID[]=10040&ProductID[]=10043&ProductID[]=10048
__________________
David Parry
SmugMug API Developer
My Photos
Old Apr-19-2008, 03:03 AM
#18
AdamN is offline AdamN
Big grins
Quote:
Originally Posted by devbobo
it does actually work, but you need to call it like this....

method=smugmug.propricing.getPortfolio&SessionID=e 0d0da5a0bf9808fcc2ffb995392030a&ProductType[]=CommonPrint&ProductType[]=Merchandise&ProductType[]=Downloads&ProductID[]=10040&ProductID[]=10043&ProductID[]=10048
Ok! Are you going to fix it to be more JSON-like, or is this how it should look?

/Adam
Old May-25-2008, 04:30 AM
#19
lildude is offline lildude
Big grins
lildude's Avatar
1.2.2's anonymous albums.get() doesn't return same info as older revs
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):

Code:
Array
(
    [0] => Array
        (
            [id] => 4644971
            [Key] => vwxmf
            [Title] => Photo of the Week
            [Category] => Array
                (
                    [id] => 0
                    [Name] => Other
                )

            [ImageCount] => 5
            [Public] => 1
            [Passworded] => 
        )

    [1] => Array
[...]
eg. 1.2.2 anonymous albums.get(Heavy=FALSE):

Code:
Array
(
    [0] => Array
        (
            [id] => 4644971
            [Key] => vwxmf
            [Category] => Array
                (
                    [id] => 0
                    [Name] => Other
                )

        )

    [1] => Array
[...]
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.
__________________
Colin Seymour
Personal Blog | Tech Blog | phpSmug
Old May-25-2008, 04:35 AM
#20
devbobo is offline devbobo OP
LR whisperer
devbobo's Avatar


something odd there...i'll check it out.

Quote:
Originally Posted by lildude
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):

Code:
Array
(
    [0] => Array
        (
            [id] => 4644971
            [Key] => vwxmf
            [Title] => Photo of the Week
            [Category] => Array
                (
                    [id] => 0
                    [Name] => Other
                )

            [ImageCount] => 5
            [Public] => 1
            [Passworded] => 
        )

    [1] => Array
[...]
eg. 1.2.2 anonymous albums.get(Heavy=FALSE):

Code:
Array
(
    [0] => Array
        (
            [id] => 4644971
            [Key] => vwxmf
            [Category] => Array
                (
                    [id] => 0
                    [Name] => Other
                )

        )

    [1] => Array
[...]
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.
__________________
David Parry
SmugMug API Developer
My Photos
Page 1  of  4
1 2 3 4
Tell The World!  

Thread Tools
Display Modes

Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump