Lurk all you'd like, but why not register and post some pics? Registering also makes it easier to find the good stuff. Need help?

Go Back   Digital Grin Photography Forum > Support > SmugMug APIs, Hacks & Tricks
Dgrinner
Password
Register FAQ Shooters Calendar Reviews Tutorials Gallery Books Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old Sep-21-2007, 11:08 PM   #1
devbobo
technicolored
 
devbobo's Avatar
 
Join Date: Nov 2004
Location: Melbourne, AU
Posts: 4,308
API 1.2.1 beta

Hi Guys,

We decided to push out an early release of 1.2.1 so that you guys can start playing.

It's not feature complete, and there will probably get a few bugs. At this point, I haven't had a chance to do the documentation, so below I have listed the new endpoints and the input parameters for the new methods.

I'm away at Glacier for the next week, so I will look at any issues when I get back.

Cheers,

David


REST: http[s]://api.smugmug.com/services/api/rest/1.2.1/
JSON: http[s]://api.smugmug.com/services/api/json/1.2.1/
PHP: http[s]://api.smugmug.com/services/api/php/1.2.1/
XML-RPC: http[s]://api.smugmug.com/services/api/xmlrpc/1.2.1/

smugmug.albums.applyWatermark
  • string SessionID
  • int AlbumID
  • int WatermarkID
smugmug.albums.removeWatermark
  • string SessionID
  • int AlbumID
smugmug.albumtemplates.create
  • string SessionID
[*]see the response from smugmug.albumtemplates.get for more parameters
smugmug.albumtemplates.changeSettings
  • string SessionID
  • int AlbumTemplateID
  • see the response from smugmug.albumtemplates.get for more parameters
smugmug.family.add
  • string SessionID
  • string NickName
smugmug.family.get
  • string SessionID
smugmug.family.remove
  • string SessionID
  • string NickName
smugmug.family.removeAll
  • string SessionID
smugmug.friends.add
  • string SessionID
  • string NickName
smugmug.friends.get
  • string SessionID
smugmug.friends.remove
  • string SessionID
  • string NickName
smugmug.friends.removeAll
  • string SessionID
smugmug.images.applyWatermark
  • string SessionID
  • int ImageID
  • int WatermarkID
smugmug.images.crop
  • string SessionID
  • int ImageID
  • int Width
  • int Height
  • int X
  • int Y
smugmug.images.removeWatermark
  • string SessionID
  • int ImageID
smugmug.images.rotate
  • string SessionID
  • int ImageID
  • int Degrees
  • bool Flip
smugmug.images.zoomThumbnail
  • string SessionID
  • int ImageID
  • int Width
  • int Height
  • int X
  • int Y
smugmug.sharegroups.addAlbum
  • string SessionID
  • int ShareGroupID
  • int AlbumID
smugmug.sharegroups.create
  • string SessionID
  • string Name
  • string Description
smugmug.sharegroups.delete
  • string SessionID
  • int ShareGroupID
smugmug.sharegroups.get
  • string SessionID
  • bool Heavy
smugmug.sharegroups.getInfo
  • string SessionID
  • int ShareGroupID
smugmug.sharegroups.removeAlbum
  • string SessionID
  • int ShareGroupID
  • int AlbumID
smugmug.themes.get
  • string SessionID
smugmug.users.getDisplayName
  • string SessionID
  • string NickName

smugmug.watermarks.changeSettings (pro only)
  • string SessionID
  • int ImageID
  • string Name
  • string Pinned (Left, Right, Center, Top, Bottom, TopLeft, TopRight, BottomLeft, BottomRight, Tile)
  • int Dissolved (0-100)
  • bool Thumbs
smugmug.watermarks.create (pro only)
  • string SessionID
  • int ImageID
  • string Name
  • string Pinned (Left, Right, Center, Top, Bottom, TopLeft, TopRight, BottomLeft, BottomRight, Tile)
  • int Dissolve (0-100)
  • bool Thumbs
smugmug.watermarks.delete (pro only)
  • string SessionID
  • int WatermarkID
smugmug.watermarks.get (pro only)
  • string SessionID
  • string Heavy
smugmug.watermarks.getInfo (pro only)
  • string SessionID
  • int WatermarkID

smugmug.products.get
  • string SessionID

smugmug.propricing.getPortfolio (pro only)
  • string SessionID
  • string/array of strings ProductType optional (CommonPrint, DigitalPrint, SpecialityPrint, Merchandise, Download)
  • int/array of ints ProductID optional

smugmug.propricing.getAlbum (pro only)
  • string SessionID
  • int AlbumID
  • string/array of strings ProductType optional (CommonPrint, DigitalPrint, SpecialityPrint, Merchandise, Download)
  • int/array of ints ProductID optional


smugmug.propricing.getImage (pro only)
  • string SessionID
  • int ImageID
  • string/array of strings ProductType optional (CommonPrint, DigitalPrint, SpecialityPrint, Merchandise, Download)
  • int/array of ints ProductID optional

Updated Methods...
smugmug.albums.get
smugmug.users.getTree

now accepts a ShareGroup parameter, which can be a single or an array of share group tags, which will expose any private albums for a given sharegroup when you call this method on another user's account.

smugmug.images.getInfo now returns Latitude, Longitude and Altitude if set.
smugmug.images.changeSettings now accepts Latitude, Longitude and Altitude
__________________
David Parry
My Photos | SmugBrowser
devbobo is offline   Reply With Quote
Old Sep-24-2007, 12:54 PM   #2
devbobo
technicolored
 
devbobo's Avatar
 
Join Date: Nov 2004
Location: Melbourne, AU
Posts: 4,308
bump
__________________
David Parry
My Photos | SmugBrowser
devbobo is offline   Reply With Quote
Old Sep-27-2007, 05:50 PM   #3
alpacaboy
Beginner grinner
 
Join Date: Sep 2007
Posts: 5
I'm still having trouble with:

users.getTransferStats:
http://api.smugmug.com/services/api/...APIKey=API_KEY
&method=smugmug.users.getTransferStats&SessionId=S ESSION_ID
&Month=9&Year=2007

(takes a long time, then just errors out with:
The requested URL could not be retrieved)

albums.getStats:
http://api.smugmug.com/services/api/...APIKey=API_KEY
&method=smugmug.albums.getStats&SessionId=SESSION_ ID
&Month=9&Year=2007&AlbumID=3504830&heavy=true

just gives me overall stats - not detailed per-image. I've also tried heavy=True,TRUE,1
The previous api 1.1.1 would return a heavy listing, but all the image stats were 0 (posted another thread about that)

I've been trying to access my per-image stats in the last couple versions, and never have been able to get them.
alpacaboy is offline   Reply With Quote
Old Oct-04-2007, 09:59 PM   #4
devbobo
technicolored
 
devbobo's Avatar
 
Join Date: Nov 2004
Location: Melbourne, AU
Posts: 4,308
Quote:
Originally Posted by alpacaboy
I'm still having trouble with:

users.getTransferStats:
http://api.smugmug.com/services/api/...APIKey=API_KEY
&method=smugmug.users.getTransferStats&SessionId=S ESSION_ID
&Month=9&Year=2007

(takes a long time, then just errors out with:The requested URL could not be retrieved)

albums.getStats:
http://api.smugmug.com/services/api/...APIKey=API_KEY
&method=smugmug.albums.getStats&SessionId=SESSION_ ID
&Month=9&Year=2007&AlbumID=3504830&heavy=true

just gives me overall stats - not detailed per-image. I've also tried heavy=True,TRUE,1
The previous api 1.1.1 would return a heavy listing, but all the image stats were 0 (posted another thread about that)

I've been trying to access my per-image stats in the last couple versions, and never have been able to get them.
yes, I am aware of this issue... however, it requires me spending some time with Don to figure it out. It's on my list of stuff that needs to be fixed.



Cheers,

David
__________________
David Parry
My Photos | SmugBrowser
devbobo is offline   Reply With Quote
Old Oct-05-2007, 06:48 PM   #5
kylemulka
Beginner grinner
 
Join Date: Oct 2007
Posts: 2
Hmm... logging in anonymously appears to be broken.

This works:
http://api.smugmug.com/hack/rest/1.2.0/?method=smugmug.login.anonymously&APIKey=<removed
This doesn't:
http://api.smugmug.com/hack/rest/1.2.1/?method=smugmug.login.anonymously&APIKey=<removed>

The first is returning what appears to be the correct XML document, the seconds is giving me nothing... no error message, nothing.
kylemulka is offline   Reply With Quote
Old Oct-05-2007, 07:06 PM   #6
devbobo
technicolored
 
devbobo's Avatar
 
Join Date: Nov 2004
Location: Melbourne, AU
Posts: 4,308
Quote:
Originally Posted by kylemulka
Hmm... logging in anonymously appears to be broken.

This works:
http://api.smugmug.com/hack/rest/1.2.0/?method=smugmug.login.anonymously&APIKey=<removed
This doesn't:
http://api.smugmug.com/hack/rest/1.2.1/?method=smugmug.login.anonymously&APIKey=<removed>

The first is returning what appears to be the correct XML document, the seconds is giving me nothing... no error message, nothing.
the endpoints for 1.2.1 are different...

http://api.smugmug.com/services/api/rest/1.2.1/?method=smugmug.login.anonymously&APIKey=<removed>
__________________
David Parry
My Photos | SmugBrowser
devbobo is offline   Reply With Quote
Old Oct-07-2007, 08:34 PM   #7
scottV
Major grins
 
scottV's Avatar
 
Join Date: Jul 2006
Location: Tustin, CA
Posts: 352
smugmug.orders.get & smugmug.orders.ship = method not found.
smugmug.users.getDisplayName = invalid API key
__________________
http://scottvickers.smugmug.com
scottV is offline   Reply With Quote
Old Oct-07-2007, 08:53 PM   #8
devbobo
technicolored
 
devbobo's Avatar
 
Join Date: Nov 2004
Location: Melbourne, AU
Posts: 4,308
Quote:
Originally Posted by f00sion
smugmug.orders.get & smugmug.orders.ship = method not found.
smugmug.users.getDisplayName = invalid API key
only the methods currently listed in this thread are implemented.

I will check out the issue with smugmug.users.getDisplayName
__________________
David Parry
My Photos | SmugBrowser
devbobo is offline   Reply With Quote
Old Oct-08-2007, 09:47 AM   #9
scottV
Major grins
 
scottV's Avatar
 
Join Date: Jul 2006
Location: Tustin, CA
Posts: 352
Quote:
Originally Posted by devbobo
only the methods currently listed in this thread are implemented.

I will check out the issue with smugmug.users.getDisplayName
gotcha, i was looking at them in the wiki.
__________________
http://scottvickers.smugmug.com
scottV is offline   Reply With Quote
Old Oct-09-2007, 09:14 AM   #10
luke_church
#Grinner
 
Join Date: Nov 2004
Posts: 506
I suspect this is probably a dumb question, but I'm afraid I haven't been keeping up... :(

Is the change in the structure of the REST responses intentional?

REST 1.2.0

<?xml version="1.0" encoding="utf-8" ?>
- <rsp stat="ok">
<method>smugmug.login.withPassword</method>

- <Login PasswordHash="..." AccountType="Pro" FileSizeLimit="25165824">
<Session id="..." />

<User id="..." NickName="..." DisplayName="Luke Church" />

</Login>


</rsp>

REST 1.2.1

<?xml version="1.0" encoding="utf-8" ?>
- <rsp stat="ok">
<method>smugmug.login.withPassword</method>

- <Login SessionID="..." PasswordHash="..." AccountType="Pro" FileSizeLimit="25165824">
<User id="..." NickName="..." DisplayName="Luke Church" />

</Login>


</rsp>




Note the change from <session id = foo> to <Login SessionID= foo>

This testing is being done shoddily, I was just prodding the API to see whether things have improved since last time, to decide whether it's worth investing time in developing something. If a rigourous demo case is required to answer the question let me know.

All the best,

Luke
__________________
Photography: www.lukechurchphotography.com
SmugSoftware: www.smugtools.com
luke_church is offline   Reply With Quote
Old Oct-09-2007, 01:18 PM   #11
devbobo
technicolored
 
devbobo's Avatar
 
Join Date: Nov 2004
Location: Melbourne, AU
Posts: 4,308
Quote:
Originally Posted by luke_church
I suspect this is probably a dumb question, but I'm afraid I haven't been keeping up... :(

Is the change in the structure of the REST responses intentional?
Luke,

yes, the change was intentional...it enabled us to generate xml-rpc, json, rest and php responses from a common code base. It has been like that for some time.

Cheers,

David
__________________
David Parry
My Photos | SmugBrowser
devbobo is offline   Reply With Quote
Old Oct-09-2007, 01:35 PM   #12
luke_church
#Grinner
 
Join Date: Nov 2004
Posts: 506
Quote:
Originally Posted by devbobo
yes, the change was intentional...it enabled us to generate xml-rpc, json, rest and php responses from a common code base. It has been like that for some time.
OK thanks David. Hope you're keeping well?
__________________
Photography: www.lukechurchphotography.com
SmugSoftware: www.smugtools.com
luke_church is offline   Reply With Quote
Old Oct-09-2007, 01:43 PM   #13
devbobo
technicolored
 
devbobo's Avatar
 
Join Date: Nov 2004
Location: Melbourne, AU
Posts: 4,308
Quote:
Originally Posted by luke_church
OK thanks David. Hope you're keeping well?
yeah but busy... how about you ?
__________________
David Parry
My Photos | SmugBrowser
devbobo is offline   Reply With Quote
Old Oct-09-2007, 02:02 PM   #14
luke_church
#Grinner
 
Join Date: Nov 2004
Posts: 506
Quote:
Originally Posted by devbobo
yeah but busy... how about you ?
Sounds familiar
__________________
Photography: www.lukechurchphotography.com
SmugSoftware: www.smugtools.com
luke_church is offline   Reply With Quote
Old Oct-09-2007, 03:28 PM   #15
mhilbush
I'm grinning
 
mhilbush's Avatar
 
Join Date: Mar 2006
Posts: 60
FWIW, this is the only difference I've seen so far between 1.2.0 and 1.2.1, and I've exercised quite a few of the APIs so far.

As for the rational for changing this response, I dunno.... I was wondering the same thing myself.

Mark

Quote:
Originally Posted by luke_church
I suspect this is probably a dumb question, but I'm afraid I haven't been keeping up... :(

Is the change in the structure of the REST responses intentional?

REST 1.2.0

<?xml version="1.0" encoding="utf-8" ?>
- <rsp stat="ok">
<method>smugmug.login.withPassword</method>

- <Login PasswordHash="..." AccountType="Pro" FileSizeLimit="25165824">
<Session id="..." />

<User id="..." NickName="..." DisplayName="Luke Church" />

</Login>


</rsp>

REST 1.2.1

<?xml version="1.0" encoding="utf-8" ?>
- <rsp stat="ok">
<method>smugmug.login.withPassword</method>

- <Login SessionID="..." PasswordHash="..." AccountType="Pro" FileSizeLimit="25165824">
<User id="..." NickName="..." DisplayName="Luke Church" />

</Login>


</rsp>




Note the change from <session id = foo> to <Login SessionID= foo>

This testing is being done shoddily, I was just prodding the API to see whether things have improved since last time, to decide whether it's worth investing time in developing something. If a rigourous demo case is required to answer the question let me know.

All the best,

Luke
mhilbush is offline   Reply With Quote
Old Oct-09-2007, 03:54 PM   #16
devbobo
technicolored
 
devbobo's Avatar
 
Join Date: Nov 2004
Location: Melbourne, AU
Posts: 4,308
Quote:
Originally Posted by mhilbush
FWIW, this is the only difference I've seen so far between 1.2.0 and 1.2.1, and I've exercised quite a few of the APIs so far.

As for the rational for changing this response, I dunno.... I was wondering the same thing myself.

Mark
Apologies

That will learn me for tackling forum threads before coffee. That's a bug, it's been fixed on my dev server.

I'll let you know when it's live.

David
__________________
David Parry
My Photos | SmugBrowser
devbobo is offline   Reply With Quote
Old Oct-14-2007, 04:21 AM   #17
mouellette
Big grins
 
mouellette's Avatar
 
Join Date: Oct 2007
Posts: 10
Caption and Keyword issue

This is my first post. I have just started working on a Ruby R/W implementation of your API and found an issue with setting captions and keywords through the API.

CAPTIONS:
Captions with quotes, end up having the quote escaped when viewed on the web. Here is a sample of what I am talking about.
Photo with escaped quote
API Call to change Caption

If I change the caption manually through the web interface it works fine, however I am working on setting up a feed from our RallyNorth.net site and manual caption editing is not an option.

KEYWORDS:
Keywords with numbers or spaces also seem to have an issue that might be centered around this quoting issue as well. For some reason I need to quote any keyword with a number or space in it, when using the API, however if I use the web interface this is not necessary.

For instance the above photo has the following keywords:
Sports, GameID365, Featured Photo, Football, High School, 2007, 200709, 20070907, North Andover, Andover

If I submit them through the API like so:
Update Keywords through API

The site only shows the following keywords:
football, sports, andover, high school, featured photo, north andover, gameid

But when I go to edit them they all appear correctly, and if I submit them from the online form as is they don't work as well, I have to quote any keyword with a number. So if I quote all keywords and submit them through the API like so:
Update keywords through API with quotes

The keywords now appear correctly on the site, however if I edit them all the quotes are escaped like so:
\"Sports\", \"GameID365\", \"Featured Photo\", \"Football\", \"High School\", \"2007\", \"200709\", \"20070907\", \"North Andover\", \"Andover\"


The keywords is not really a big issue since I do get the desired results, however the caption issue is a little more important, since that is what the user sees when viewing the photos.
mouellette is offline   Reply With Quote
Old Oct-14-2007, 09:18 AM   #18
mouellette
Big grins
 
mouellette's Avatar
 
Join Date: Oct 2007
Posts: 10
Caption character support

In reference to the last post, I tried setting a caption using all ASCII characters from 32 to 255, and all the characters worked fine except for:

%34 - " - double quote (escaped)
%39 - ' - apostrophe (escaped)
%92 - \ - backslash (escaped)

I also found that entities could be used easily enough, for instance you could use "%26apos;" or "%26quot;" for single and double quotes.

But there is still the issue with quoting if you want to put a URL in the caption, for instance passing:
<a href="http://smugmug.com">smugmug</a>
results in the following being output when viewing the photo:
<a href=\"http://smugmug.com\">smugmug</a>

This obviously prevents the URL from being valid.
mouellette is offline   Reply With Quote
Old Oct-16-2007, 12:24 PM   #19
darryl
Major grins
 
Join Date: May 2004
Posts: 1,039
Hi Mouellette:

In this thread I've talked about similar problems I've been having with Keywords. I was so excited to find your post, and I tried using %26quot;foo%26quot; in a keyword, but to no avail. When I look at it on the website, it appears exactly as I've typed it above.

Suck.

--Darryl

Quote:
Originally Posted by mouellette
In reference to the last post, I tried setting a caption using all ASCII characters from 32 to 255, and all the characters worked fine except for:

%34 - " - double quote (escaped)
%39 - ' - apostrophe (escaped)
%92 - \ - backslash (escaped)

I also found that entities could be used easily enough, for instance you could use "%26apos;" or "%26quot;" for single and double quotes.

But there is still the issue with quoting if you want to put a URL in the caption, for instance passing:
<a href="http://smugmug.com">smugmug</a>
results in the following being output when viewing the photo:
<a href=\"http://smugmug.com\">smugmug</a>

This obviously prevents the URL from being valid.
darryl is offline   Reply With Quote
Old Oct-17-2007, 05:52 AM   #20
mouellette
Big grins
 
mouellette's Avatar
 
Join Date: Oct 2007
Posts: 10
The keywords still seem to work correctly if you put the quotes in. When you edit the keywords you get the extra backslashes like \"foo\" but they display correctly to the user. My concern was how quotes display to the user in a caption. The extra backslash is confusing, so you need to use the entity.

Quote:
Originally Posted by darryl
Hi Mouellette:

In this thread I've talked about similar problems I've been having with Keywords. I was so excited to find your post, and I tried using %26quot;foo%26quot; in a keyword, but to no avail. When I look at it on the website, it appears exactly as I've typed it above.

Suck.

--Darryl
mouellette is offline   Reply With Quote
Reply

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


Times are GMT -8.   It's 09:16 AM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.