API 1.2.1 beta

devbobodevbobo LR whispererMelbourne, AURegistered Users, Retired Mod Posts: 4,339 SmugMug Employee
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://api.smugmug.com/services/api/rest/1.2.1/
JSON: http://api.smugmug.com/services/api/json/1.2.1/
PHP: http://api.smugmug.com/services/api/php/1.2.1/
XML-RPC: http://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
SmugMug API Developer
My Photos
«13

Comments

  • devbobodevbobo LR whisperer Melbourne, AURegistered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited September 24, 2007
    bump :D
    David Parry
    SmugMug API Developer
    My Photos
  • alpacaboyalpacaboy Beginner grinner Registered Users Posts: 5 Beginner grinner
    edited September 27, 2007
    I'm still having trouble with:

    users.getTransferStats:
    http://api.smugmug.com/services/api/rest/1.2.1/?APIKey=API_KEY
    &method=smugmug.users.getTransferStats&SessionId=SESSION_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/rest/1.2.1/?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.
  • devbobodevbobo LR whisperer Melbourne, AURegistered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited October 5, 2007
    alpacaboy wrote:
    I'm still having trouble with:

    users.getTransferStats:
    http://api.smugmug.com/services/api/rest/1.2.1/?APIKey=API_KEY
    &method=smugmug.users.getTransferStats&SessionId=SESSION_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/rest/1.2.1/?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.

    thumb.gif

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • kylemulkakylemulka Beginner grinner Registered Users Posts: 2 Beginner grinner
    edited October 5, 2007
    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&gt;

    The first is returning what appears to be the correct XML document, the seconds is giving me nothing... no error message, nothing.
  • devbobodevbobo LR whisperer Melbourne, AURegistered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited October 5, 2007
    kylemulka wrote:
    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&gt;

    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&gt;
    David Parry
    SmugMug API Developer
    My Photos
  • scottVscottV Major grins Registered Users Posts: 354 Major grins
    edited October 8, 2007
    smugmug.orders.get & smugmug.orders.ship = method not found.
    smugmug.users.getDisplayName = invalid API key
  • devbobodevbobo LR whisperer Melbourne, AURegistered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited October 8, 2007
    f00sion wrote:
    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
    SmugMug API Developer
    My Photos
  • scottVscottV Major grins Registered Users Posts: 354 Major grins
    edited October 8, 2007
    devbobo wrote:
    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.
  • luke_churchluke_church #Grinner Registered Users Posts: 507 Major grins
    edited October 9, 2007
    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" ?>
    [URL="file:///C:/Users/Luke%20Church/AppData/Local/Temp/VSD1.tmp.XML#"]-[/URL] <rsp stat="ok">
    <method>smugmug.login.withPassword</method>

    [URL="file:///C:/Users/Luke%20Church/AppData/Local/Temp/VSD1.tmp.XML#"]-[/URL] <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" ?>
    [URL="file:///C:/Users/Luke%20Church/AppData/Local/Temp/VSD1.tmp.XML#"]-[/URL] <rsp stat="ok">
    <method>smugmug.login.withPassword</method>

    [URL="file:///C:/Users/Luke%20Church/AppData/Local/Temp/VSD1.tmp.XML#"]-[/URL] <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
  • devbobodevbobo LR whisperer Melbourne, AURegistered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited October 9, 2007
    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
    SmugMug API Developer
    My Photos
  • luke_churchluke_church #Grinner Registered Users Posts: 507 Major grins
    edited October 9, 2007
    devbobo wrote:
    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?
  • devbobodevbobo LR whisperer Melbourne, AURegistered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited October 9, 2007
    OK thanks David. Hope you're keeping well?

    yeah but busy... how about you ?
    David Parry
    SmugMug API Developer
    My Photos
  • luke_churchluke_church #Grinner Registered Users Posts: 507 Major grins
    edited October 9, 2007
    devbobo wrote:
    yeah but busy... how about you ?

    Sounds familiar mwink.gif
  • mhilbushmhilbush I'm grinning Registered Users Posts: 70 Big grins
    edited October 9, 2007
    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
    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" ?>
    [URL="file:///C:/Users/Luke%20Church/AppData/Local/Temp/VSD1.tmp.XML#"]-[/URL] <rsp stat="ok">
    <method>smugmug.login.withPassword</method>

    [URL="file:///C:/Users/Luke%20Church/AppData/Local/Temp/VSD1.tmp.XML#"]-[/URL] <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" ?>
    [URL="file:///C:/Users/Luke%20Church/AppData/Local/Temp/VSD1.tmp.XML#"]-[/URL] <rsp stat="ok">
    <method>smugmug.login.withPassword</method>

    [URL="file:///C:/Users/Luke%20Church/AppData/Local/Temp/VSD1.tmp.XML#"]-[/URL] <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
    Mark
  • devbobodevbobo LR whisperer Melbourne, AURegistered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited October 9, 2007
    mhilbush wrote:
    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 :D

    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
    SmugMug API Developer
    My Photos
  • mouellettemouellette Big grins Registered Users Posts: 11 Big grins
    edited October 14, 2007
    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.
  • mouellettemouellette Big grins Registered Users Posts: 11 Big grins
    edited October 14, 2007
    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:
    smugmug
    results in the following being output when viewing the photo:
    smugmug

    This obviously prevents the URL from being valid.
  • darryldarryl Major grins Registered Users Posts: 1,001 Major grins
    edited October 16, 2007
    Hi Mouellette:

    In [thread=73837]this thread[/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 wrote:
    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&gt;
    results in the following being output when viewing the photo:
    <a href=\"http://smugmug.com\">smugmug</a&gt;

    This obviously prevents the URL from being valid.
  • mouellettemouellette Big grins Registered Users Posts: 11 Big grins
    edited October 17, 2007
    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.
    darryl wrote:
    Hi Mouellette:

    In [thread=73837]this thread[/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
  • darryldarryl Major grins Registered Users Posts: 1,001 Major grins
    edited October 18, 2007
    mouellette wrote:
    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.

    Well, the problem was that I thought I might have multiple guest users, including newbies, editing the keywords in the UI.

    If there was an existing keyword, for say, Ty, that looked like \"Ty\" and they just wanted to add Will and John, the backslashes might be confusing to a non-coder.

    But I think I'll be bypassing the problem by implementing my hack to convert comments to keywords on an hourly basis. (They'll have to have "keywords:" or "tags:" at the beginning for my script to pick them up.)
  • mouellettemouellette Big grins Registered Users Posts: 11 Big grins
    edited October 18, 2007
    darryl wrote:
    But I think I'll be bypassing the problem by implementing my hack to convert comments to keywords on an hourly basis. (They'll have to have "keywords:" or "tags:" at the beginning for my script to pick them up.)

    That sounds like an interesting hack, can you share it when you get it working.
  • darryldarryl Major grins Registered Users Posts: 1,001 Major grins
    edited October 24, 2007
    mouellette wrote:
    That sounds like an interesting hack, can you share it when you get it working.

    Here ya go: http://www.dgrin.com/showthread.php?p=660273
  • GarethLewinGarethLewin Big grinning learning guy Registered Users Posts: 95 Big grins
    edited October 27, 2007
    I found either a bug in 1.2.1 or a bug in the documentation, or just a lack of consistancy.

    I was trying to force my coce to error so I could test my error handling code, so I didn't pass the SessionId to smugmug.albums.get

    (My URI that I used was

    http://api.smugmug.com/services/api/rest/1.2.1/?method=smugmug.albums.get&Heavy=1

    and it returned a valid result.

    On a side note, it would be really cool if I could ask for a gallery list for a user without being logged in. I realise I wouldn't get private galleries etc, but still would be useful for what I am doing.
    devbobo wrote:
    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://api.smugmug.com/services/api/rest/1.2.1/
    JSON: http://api.smugmug.com/services/api/json/1.2.1/
    PHP: http://api.smugmug.com/services/api/php/1.2.1/
    XML-RPC: http://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
    • 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.removeWaterwark
    • string SessionID
    • int ImageID
    smugmug.images.rotate
    • string SessionID
    • 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.waterwarks.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 Dissolved (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
  • devbobodevbobo LR whisperer Melbourne, AURegistered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited October 28, 2007
    I found either a bug in 1.2.1 or a bug in the documentation, or just a lack of consistancy.

    I was trying to force my coce to error so I could test my error handling code, so I didn't pass the SessionId to smugmug.albums.get

    (My URI that I used was

    http://api.smugmug.com/services/api/rest/1.2.1/?method=smugmug.albums.get&Heavy=1

    and it returned a valid result.

    On a side note, it would be really cool if I could ask for a gallery list for a user without being logged in. I realise I wouldn't get private galleries etc, but still would be useful for what I am doing.

    Gareth,

    There is a simple explanation for this, even though you didn't provide implicitly in the request, the browser actually sent the session id cookie with the request. You can double check this by sniffing your packets in wireshark/ethereal or the like.

    To you get a non-logged in view of your albums, login anonymously and then get albums.get witht NickName option. thumb.gif

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • GarethLewinGarethLewin Big grinning learning guy Registered Users Posts: 95 Big grins
    edited October 28, 2007
    devbobo wrote:
    Gareth,

    There is a simple explanation for this, even though you didn't provide implicitly in the request, the browser actually sent the session id cookie with the request. You can double check this by sniffing your packets in wireshark/ethereal or the like.

    To you get a non-logged in view of your albums, login anonymously and then get albums.get witht NickName option. thumb.gif

    Cheers,

    David

    Oh Gosh Darnit, I missed the nickname option.

    Now I have to go change my code and I was about to release it :)
  • devbobodevbobo LR whisperer Melbourne, AURegistered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited October 28, 2007
    Oh Gosh Darnit, I missed the nickname option.

    Now I have to go change my code and I was about to release it :)

    The NickName option is only required when calling albums.get with an anonymous session or on another user's galleries. thumb.gif
    David Parry
    SmugMug API Developer
    My Photos
  • GarethLewinGarethLewin Big grinning learning guy Registered Users Posts: 95 Big grins
    edited October 28, 2007
    devbobo wrote:
    The NickName option is only required when calling albums.get with an anonymous session or on another user's galleries. thumb.gif

    Yup, that is what I do in SmugSaver. If you do not give me your account details, I will use the nickname you supply.

    Is there any way to find out the nickname of a user with a non-smugmug domain? (Like your site)?
  • cabbeycabbey SmugMug Sorcerer Wilsonville, ORRegistered Users Posts: 1,053 Major grins
    edited October 28, 2007
    Is there any way to find out the nickname of a user with a non-smugmug domain? (Like your site)?

    This is a hack, but it's worked for me every time I've wanted to do that: get the homepage, in the header get one of the links. I've been using the rss+xml one, the nickname is the Data parameter in the href.

    example:
    [HTML]<link rel="alternate" type="application/rss+xml" title="SmugMug: introversion's recent galleries RSS feed" href="/hack/feed.mg?Type=nickname&Data=introversion&format=rss200" />[/HTML]

    so devbobo's nickname on smugmug is introversion.
    SmugMug Sorcerer - Engineering Team Champion for Commerce, Finance, Security, and Data Support
    http://wall-art.smugmug.com/
  • GarethLewinGarethLewin Big grinning learning guy Registered Users Posts: 95 Big grins
    edited October 28, 2007
    Thanks. I'll look into using that.
    cabbey wrote:
    This is a hack, but it's worked for me every time I've wanted to do that: get the homepage, in the header get one of the links. I've been using the rss+xml one, the nickname is the Data parameter in the href.

    example:
    [html]<link rel="alternate" type="application/rss+xml" title="SmugMug: introversion's recent galleries RSS feed" href="/hack/feed.mg?Type=nickname&Data=introversion&format=rss200" />[/html]
    so devbobo's nickname on smugmug is introversion.
  • kansaschuckkansaschuck In Kansas using Smugmug Registered Users Posts: 50 Big grins
    edited December 1, 2007
    PHP method=smugmug.images.applyWatermark
    Happy to join the API 1.2.1 party.

    I'll be doing some testing with the applyWatermark. And my main code is now all running 1.2.1.

    smugmug.images.applyWatermark
    • string SessionID
    • int ImageID
    • int WatermarkID
    I'll know soon enough with some testing but I have these questions:

    1) Does the watermark need to reside in the gallery with the picture? or can I have a seperate, non-viewable gallery with the my watermarks?


    2) I'll have to review the picture size limits on watermark. I wish that was removed and let the pics be watermarked. (see error below)
    F1b Failure for ?method=smugmug.images.applyWatermark Info to follow:

    F1b API code statement to follow: https://api.smugmug.com/services/api/php/1.2.1/
    ?method=smugmug.images.applyWatermark&SessionID=<removed>
    &ImageID=227553672&WatermarkID=187022140&output=phpArray
    (
    [stat] => fail
    [code] => 16
    [message] => invalid data (image is too small to watermark)
    )

    But so far so good with 1.2.1.

    KC
Sign In or Register to comment.