Options

API 1.2.1 beta

2

Comments

  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited December 1, 2007
    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

    G'day Chuck,

    Yes, the watermark image can be any image from your account.

    The error message regarding the image being too small to watermarking, that's a system imposed restrictiond that I need to honour. Currently, images need to be greater that 800 pixels on the longest side.

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • Options
    kansaschuckkansaschuck Registered Users Posts: 50 Big grins
    edited December 5, 2007
    WatermarkID
    Hi,

    I've been working with
    smugmug.images.applyWatermark

    I'm having some trouble identifiying the WatermarkID API code statement to follow:
    https://api.smugmug.com/services/api/php/1.2.1/?method=smugmug.images.applyWatermark&SessionID=<&gt;
    &ImageID=226618199&WatermarkID=SmugMug&output=phpArray
    (
    [stat] => fail
    [code] => 16
    [message] => invalid data (watermark id)

    I've tried the names (letters) and the numbers for the watermark images and have been getting the error listed above.

    Thanks,
    Chuck
  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited December 5, 2007
    Hi,

    I've been working with
    smugmug.images.applyWatermark

    I'm having some trouble identifiying the WatermarkID API code statement to follow:
    https://api.smugmug.com/services/api/php/1.2.1/?method=smugmug.images.applyWatermark&SessionID=<&gt;
    &ImageID=226618199&WatermarkID=SmugMug&output=phpArray
    (
    [stat] => fail
    [code] => 16
    [message] => invalid data (watermark id)

    I've tried the names (letters) and the numbers for the watermark images and have been getting the error listed above.

    Thanks,
    Chuck

    The WatermarkID isn't the ImageID of the image used for the watermark, you need to get a list of valid watermarks by calling smugmug.watermarks.get.

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • Options
    kansaschuckkansaschuck Registered Users Posts: 50 Big grins
    edited December 5, 2007
    great!
    devbobo wrote:
    The WatermarkID isn't the ImageID of the image used for the watermark, you need to get a list of valid watermarks by calling smugmug.watermarks.get.

    Cheers,

    David

    Ok.. that fixed that. Thanks
  • Options
    SilikSilik Registered Users Posts: 22 Big grins
    edited December 8, 2007
    devbobo wrote:
    <snip>

    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
    I'm having problems with the new ShareGroup parameter, and haven't found any further comments through various searches.

    I manage to anonymously login just fine:

    http://api.smugmug.com/services/api/json/1.2.1?method=smugmug.login.anonymously&APIKey=<key>&JSONCallback=<callback&gt;


    I then have problems getting the share group albums:

    http://api.smugmug.com/services/api/json/1.2.1?method=smugmug.albums.get&APIKey=<key>&JSONCallback=<callback>&ShareGroupID=<share_group_id>&Heavy=1&SessionID=<session&gt;

    I get back: ({stat:"fail", code:4, message:"invalid user"})

    I've tried both ShareGroup and ShareGroupID, both of which give the same return. Is there something I'm missing in here? The documentation for smugmug.albums.get seems to still be lacking, but somewhere I read that ShareGroupID should be an int, and all I can find for a sharegroup is a really long ugly string, not an int. Can I get an int somewhere instead?
  • Options
    chirayuchirayu Registered Users Posts: 5 Beginner grinner
    edited December 9, 2007
    Bug - albums.changesettings - calling the function with the same data fails
    Hi,

    Hit upon this bug while testing the object oriented Python API's. (FYI, these API's work on top of the functional API's that I released last week).

    Bug:

    Calling albums.changesettings with the same set of parameters fail (I get System Error). To get around it I have to change atleast one parameter.

    regards,
    CP
  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited December 9, 2007
    Silik wrote:
    I'm having problems with the new ShareGroup parameter, and haven't found any further comments through various searches.

    I manage to anonymously login just fine:

    http://api.smugmug.com/services/api/json/1.2.1?method=smugmug.login.anonymously&APIKey=<key>&JSONCallback=<callback&gt;


    I then have problems getting the share group albums:

    http://api.smugmug.com/services/api/json/1.2.1?method=smugmug.albums.get&APIKey=<key>&JSONCallback=<callback>&ShareGroupID=<share_group_id>&Heavy=1&SessionID=<session&gt;

    I get back: ({stat:"fail", code:4, message:"invalid user"})

    I've tried both ShareGroup and ShareGroupID, both of which give the same return. Is there something I'm missing in here? The documentation for smugmug.albums.get seems to still be lacking, but somewhere I read that ShareGroupID should be an int, and all I can find for a sharegroup is a really long ugly string, not an int. Can I get an int somewhere instead?

    The reason why this method is failing is because you haven't provided the NickName parameter, since you logged in anonymously. At this point, you can only provide the actual ShareGroup string (the long ugly one).

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited December 9, 2007
    chirayu wrote:
    Hi,

    Hit upon this bug while testing the object oriented Python API's. (FYI, these API's work on top of the functional API's that I released last week).

    Bug:

    Calling albums.changesettings with the same set of parameters fail (I get System Error). To get around it I have to change atleast one parameter.

    regards,
    CP

    Hey CP,

    I would have to say that returning this error was by design, and not really a bug.

    However, in saying that, this issue will be fixed as part of supporting setting the ThemeID at gallery level...hopefully very soon.

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • Options
    SilikSilik Registered Users Posts: 22 Big grins
    edited December 9, 2007
    devbobo wrote:
    The reason why this method is failing is because you haven't provided the NickName parameter, since you logged in anonymously. At this point, you can only provide the actual ShareGroup string (the long ugly one).

    Cheers,

    David

    Am I supposed to supply ShareGroup=<ugly string> or ShareGroupID=<ugly string>. And what is the ugly string? Everything after "share/" in the "http://blahblahblah/share/<stuff>&quot; url?

    I've tried that, but keep being told invalid user. If I provide a NickName in smugmug.albums.get, I get all of the albums, whether or not I give a ShareGroup (or ShareGroupID) parameter.
  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited December 9, 2007
    Silik wrote:
    Am I supposed to supply ShareGroup=<ugly string> or ShareGroupID=<ugly string>. And what is the ugly string? Everything after "share/" in the "http://blahblahblah/share/<stuff>&quot; url?

    I've tried that, but keep being told invalid user. If I provide a NickName in smugmug.albums.get, I get all of the albums, whether or not I give a ShareGroup (or ShareGroupID) parameter.

    My original intent of allowing ShareGroups to be added to this method was to expose private albums for another user's account (in addition to their pubically available ones) for which you had been given the ShareGroup url. That being the case, the user would only typically have access to the sharegroup url, from which they could extract the long ShareGroup string.

    To be honest, I didn't think about the case, where a user might want to just get a listing of the albums for that sharegroup (except for the owner). I believe that modifying smugmug.sharegroups.getInfo would be the best option in this case.

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited December 9, 2007
    Silik wrote:
    Am I supposed to supply ShareGroup=<ugly string> And what is the ugly string? Everything after "share/" in the "http://blahblahblah/share/<stuff>&quot; url?

    yes and yes
    David Parry
    SmugMug API Developer
    My Photos
  • Options
    SilikSilik Registered Users Posts: 22 Big grins
    edited December 9, 2007
    devbobo wrote:
    My original intent of allowing ShareGroups to be added to this method was to expose private albums for another user's account (in addition to their pubically available ones) for which you had been given the ShareGroup url. That being the case, the user would only typically have access to the sharegroup url, from which they could extract the long ShareGroup string.

    To be honest, I didn't think about the case, where a user might want to just get a listing of the albums for that sharegroup (except for the owner). I believe that modifying smugmug.sharegroups.getInfo would be the best option in this case.

    Cheers,

    David

    smugmug.sharegroups.getInfo seems to not get me any closer, however. Giving it any of the four combination of ShareGroup{ID,""} with {NickName, ""} still gives me an invalid user error. ShareGroups seem like they require being logged in to get any useful data from, although I'm guessing it's really a problem on my end and I'm not passing data correctly.

    Do you have to be logged in to work with share groups? If not, do you have example arguments that should give me some output for an anonymous connection?
  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited December 9, 2007
    Silik wrote:
    smugmug.sharegroups.getInfo seems to not get me any closer, however. Giving it any of the four combination of ShareGroup{ID,""} with {NickName, ""} still gives me an invalid user error. ShareGroups seem like they require being logged in to get any useful data from, although I'm guessing it's really a problem on my end and I'm not passing data correctly.

    Do you have to be logged in to work with share groups? If not, do you have example arguments that should give me some output for an anonymous connection?

    at present, there is no way to return a listing of only albums contained in a sharegroup for an anonymous or non-owner session. I need to have a bit of think about whether it's best to implement this...I'm leaning towards smugmug.sharegroups.getInfo...but don't want to make that sort of call after I have just gotten off a 14 hour plane flight :D

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • Options
    SilikSilik Registered Users Posts: 22 Big grins
    edited December 9, 2007
    devbobo wrote:
    at present, there is no way to return a listing of only albums contained in a sharegroup for an anonymous or non-owner session. I need to have a bit of think about whether it's best to implement this...I'm leaning towards smugmug.sharegroups.getInfo...but don't want to make that sort of call after I have just gotten off a 14 hour plane flight :D

    Cheers,

    David

    Nod, if they've got the sharegroup ID, it seems useful to be able to use it, even if you're not an owner. Ah well, I guess my current project will have to go on hold until I can use sharegroups anonymously. :) Thanks!
  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited December 9, 2007
    Silik wrote:
    Nod, if they've got the sharegroup ID, it seems useful to be able to use it, even if you're not an owner. Ah well, I guess my current project will have to go on hold until I can use sharegroups anonymously. :) Thanks!

    once I get my head around it, I will be able to get the code change out pretty quickly.
    David Parry
    SmugMug API Developer
    My Photos
  • Options
    mhilbushmhilbush Registered Users Posts: 70 Big grins
    edited December 23, 2007
    smugmug.albumtemplates.delete
    Any prediction on when you'll implement smugmug.albumtemplates.delete?

    Mark
    Mark
  • Options
    mhilbushmhilbush Registered Users Posts: 70 Big grins
    edited December 27, 2007
    Broken watermarks
    devbobo wrote:
    The WatermarkID isn't the ImageID of the image used for the watermark, you need to get a list of valid watermarks by calling smugmug.watermarks.get.
    This begs another question...

    What is considered a valid watermark? For instance, if the image referenced by the watermark no longer exists (let's say it was deleted), smugmug.watermarks.get still returns the information about the watermark, however, the image ID returned in the response is invalid.

    There are several ways to deal with this. On my side, as I iterate through the list of watermarks, I can validate that the image ID still references an existing image.

    Alternatively, on the server side, the watermark(s) could be deleted when an image is deleted. Unfortunately, there may be a big overhead associated with performing this check, as the percentage of images that are referenced by watermarks must be tiny.

    Or, smugmug.watermarks.get could check that the image exists as it builds the response. If the image doesn't exist, you could either return an indicator in the response, or just delete the watermark at that time.

    What's really in question here is the way you should deal with broken watermarks. I notice that the Smugmug web site doesn't deal with this situation very well. There's no way to "fix" a watermark whose image no longer exists (other than deleting it).

    Mark
    Mark
  • Options
    barriaultbarriault Registered Users Posts: 9 Beginner grinner
    edited December 27, 2007
    Hey guys I'm working on a Rails based plugin using the JSON endpoint since JSON support is built into Rails. I've made some decent progress today, but I just hit a snag. Not sure if it is a bug or if I'm just being stupid. I figured I'd tackle categories first since it seemed easy. Get and create are working great, but delete and rename are returning errors.

    For delete I'm sending:
    http://api.smugmug.com/services/api/json/1.2.1/
    ?APIKey=**My Key**
    &SessionID=**A valid session id**
    &method=smugmug.categories.delete
    &id=225600

    And for rename I'm sending:
    http://api.smugmug.com/services/api/json/1.2.1/
    ?APIKey=**My Key**
    &SessionID=**A valid session id**
    &method=smugmug.categories.rename
    &Name=AATesting
    &id=225600

    They both keep returning an "invalid user" error.

    Any ideas?
  • Options
    barriaultbarriault Registered Users Posts: 9 Beginner grinner
    edited December 27, 2007
    mhilbush wrote:

    Well it is definately an idiot error on my part. The get method returns an array of categories with a variable named id, but the delete and rename methods require a variable named CategoryID. I found it when working on my album class and my getInfo method returned a system error (invalid album id).

    I still think it's a bug though. I would think that the rename and delete for categories should return a system error similar to the albums.getInfo method instead of the invalid user error I'm seeing.
  • Options
    SilikSilik Registered Users Posts: 22 Big grins
    edited January 3, 2008
    devbobo wrote:
    once I get my head around it, I will be able to get the code change out pretty quickly.
    Any update on this?
  • Options
    edhaberedhaber Registered Users Posts: 3 Beginner grinner
    edited March 28, 2008
    images.get with heavy
    Hi i think i found a bug with images.get with heavy.
    With heavy the response doesn't include the image Key.

    -Ed
  • Options
    tkarakaitkarakai Registered Users Posts: 2 Beginner grinner
    edited March 30, 2008
    Silik wrote:
    Any update on this?

    It seems that the development of 1.2.1 version API was abandoned in December/January while still in beta. Can we expect a stable version released in the near future? Or not so near future? Any time? (or did I miss something?)

    I am planning to use it and since it has significant improvenets over the 1.2.0 verison, so it would be great if I knew that I could count on it.

    Any information regarding the future of the API is appreciated.

    Thanks!
  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited March 30, 2008
    edhaber wrote:
    Hi i think i found a bug with images.get with heavy.
    With heavy the response doesn't include the image Key.

    -Ed

    Ed,

    Please provide me with the Album that you are running the request with as well as the api version/type. It seems to be working fine for me.

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited March 30, 2008
    tkarakai wrote:
    It seems that the development of 1.2.1 version API was abandoned in December/January while still in beta. Can we expect a stable version released in the near future? Or not so near future? Any time? (or did I miss something?)

    I am planning to use it and since it has significant improvenets over the 1.2.0 verison, so it would be great if I knew that I could count on it.

    Any information regarding the future of the API is appreciated.

    Thanks!

    API development definitely hasn't been abandoned. I am currently in the process of refactoring the APi so that I can implement OAuth. During the refactoring process, I am optimising/enhancing existing methods as well as attempting to address any outstanding issues. At this point, I plan to release a new version of the API prior to starting development of the OAuth stuff.

    In regard to the stability of 1.2.1, we use 1.2.1 internally for some of our products, so despite it still being in beta... we treat it as a released version.

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • Options
    edhaberedhaber Registered Users Posts: 3 Beginner grinner
    edited March 30, 2008
    devbobo wrote:
    Ed,

    Please provide me with the Album that you are running the request with as well as the api version/type. It seems to be working fine for me.

    Cheers,

    David

    I sent an email through the forum.
    I'm using phpSmug 1.1.7.
    It is using the php endpoint 1.2.1

    -Ed
  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited March 30, 2008
    edhaber wrote:
    I sent an email through the forum.
    I'm using phpSmug 1.1.7.
    It is using the php endpoint 1.2.1

    -Ed

    Ed,

    I haven't received any email, please send to david at smugmug dot com
    David Parry
    SmugMug API Developer
    My Photos
  • Options
    edhaberedhaber Registered Users Posts: 3 Beginner grinner
    edited March 30, 2008
    devbobo wrote:
    Ed,

    I haven't received any email, please send to david at smugmug dot com

    Ok. I resent it.
  • Options
    tkarakaitkarakai Registered Users Posts: 2 Beginner grinner
    edited April 1, 2008
    devbobo wrote:
    API development definitely hasn't been abandoned. I am currently in the process of refactoring the APi so that I can implement OAuth. During the refactoring process, I am optimising/enhancing existing methods as well as attempting to address any outstanding issues. At this point, I plan to release a new version of the API prior to starting development of the OAuth stuff.

    In regard to the stability of 1.2.1, we use 1.2.1 internally for some of our products, so despite it still being in beta... we treat it as a released version.

    Cheers,

    David
    That's very good news! Thanks. I will give it a try shortly.
  • Options
    iotashaniotashan Registered Users Posts: 68 Big grins
    edited April 5, 2008
    devbobo wrote:
    API development definitely hasn't been abandoned. I am currently in the process of refactoring the APi so that I can implement OAuth. During the refactoring process, I am optimising/enhancing existing methods as well as attempting to address any outstanding issues. At this point, I plan to release a new version of the API prior to starting development of the OAuth stuff.

    In regard to the stability of 1.2.1, we use 1.2.1 internally for some of our products, so despite it still being in beta... we treat it as a released version.

    Cheers,

    David

    So how's it going? I'm building all my projects off of 1.2.1, and you know I'm anxious to get my hands on the OAuth stuff :)

    Shan
Sign In or Register to comment.