getTree only returns public albums

CAPCAP Registered Users Posts: 6 Beginner grinner
Hi,

I noticed this around two weeks ago or so: the getTree method I was always using to get all the albums on my account doesn't return any of my private albums anymore.

Here's the actual call I'm doing:
https://api.smugmug.com/services/api/json/1.2.2/?method=smugmug.users.getTree&SessionID=<my_sessionid>&Heavy=1&NickName=<my_nickname>&amp;

And if I got it right, you did some changes to the logon procedure recently, so just in case here's the logon call I'm doing right before the getTree:
https://api.smugmug.com/services/api/json/1.2.2/?method=smugmug.login.withPassword&APIKey=<my_APIkey>&EmailAddress=<my_nickname>&Password=<my_password>&amp;

So, my question would be: is this a bug or a feature (due to API changes) and how can I make it work as before?


Best Regards,

CAP

Comments

  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited November 30, 2010
    G'day CAP,

    What's your SmugMug nickname so that I can take a look ?

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • CAPCAP Registered Users Posts: 6 Beginner grinner
    edited December 1, 2010
    devbobo wrote: »
    G'day CAP,

    What's your SmugMug nickname so that I can take a look ?

    Cheers,

    David

    cadam

    Thanks!
  • CAPCAP Registered Users Posts: 6 Beginner grinner
    edited December 2, 2010
    Hi David,

    did you get a chance to see whats wrong? Do I need one of those new APIKeys to make it work again?

    Regards,

    CAP
  • MaRiMaRi Registered Users Posts: 21 Big grins
    edited December 2, 2010
    smugmug.albums.get
    Hi.
    I have a similar problem with smugmug.albums.get - it only returns my public albums, not the ones that are unlisted.
    I can give more details if needed.
    Thanks.
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited December 8, 2010
    We recently implemented some changes to prevent sidejacking. If you want to make all api calls over https, your subsequent calls after login need to send the _su cookie (returned from login calls). The other alternative is to call the smugmug.login.* methods over https and the rest over http.

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • MaRiMaRi Registered Users Posts: 21 Big grins
    edited December 8, 2010
    Yes, I noticed that on another thread and I made the changes. I get the _su cookie with the log in and send it with all the subsequent calls.
    The problem now is that some of the functions are working (I can get albums, get themes, get categories, are some of the ones that are working; and get albums returns the albums that are unlisted as well, so it works properly now), but I can't create anything or delete anything. And I'm a bit stuck cause I've done the same changes to all the functions. Have you seen this problem before?
    Thanks!
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited December 8, 2010
    MaRi wrote: »
    Yes, I noticed that on another thread and I made the changes. I get the _su cookie with the log in and send it with all the subsequent calls.
    The problem now is that some of the functions are working (I can get albums, get themes, get categories, are some of the ones that are working; and get albums returns the albums that are unlisted as well, so it works properly now), but I can't create anything or delete anything. And I'm a bit stuck cause I've done the same changes to all the functions. Have you seen this problem before?
    Thanks!

    what error are you receiving ? Have you tried making the calls manually via browser ?
    David Parry
    SmugMug API Developer
    My Photos
  • MaRiMaRi Registered Users Posts: 21 Big grins
    edited December 9, 2010
    I hadn't thought of doing that before. I called smugmug.albums.create over the browser manually with:
    https://secure.smugmug.com/services/api/json/1.2.2/?SessionID=XXX&_su=XXX&method=smugmug.albums.create&APIKey=XXX&Pretty=true&Title=TestAlbumTitleOnly&Unique=False&SortMethod=Position&ColorCorrection=No
    And I got this:
    {
    "stat": "fail",
    "method": "smugmug.albums.create",
    "code": 3,
    "message": "invalid session"
    }
    Thanks!
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited December 9, 2010
    MaRi wrote: »
    I hadn't thought of doing that before. I called smugmug.albums.create over the browser manually with:
    https://secure.smugmug.com/services/api/json/1.2.2/?SessionID=XXX&_su=XXX&method=smugmug.albums.create&APIKey=XXX&Pretty=true&Title=TestAlbumTitleOnly&Unique=False&SortMethod=Position&ColorCorrection=No
    And I got this:
    {
    "stat": "fail",
    "method": "smugmug.albums.create",
    "code": 3,
    "message": "invalid session"
    }
    Thanks!

    make sure you call login first, then it should work correctly
    David Parry
    SmugMug API Developer
    My Photos
  • MaRiMaRi Registered Users Posts: 21 Big grins
    edited December 10, 2010
    Yes. I do call log in first and I do have a valid SessionID and _su cookie for every request that I send.
    I send the _su cookie with every call, but I've noticed that users.getTree and getAlbums only retrieve the unlisted albums for a very small number of these calls. For the rest of them, I only get the public albums.
    I get an error when I try to log out ("code":3,"message":"invalid session"}).
    And I still can't create albums. I get the invalid session error.
  • MaRiMaRi Registered Users Posts: 21 Big grins
    edited December 14, 2010
    Just wondering if anyone has run into this problem or had time to look into it.
    For now I'm doing the log in over https and everything else over http and it works.

    Thanks!
Sign In or Register to comment.