[RESOLVED] Getting albums in category

nickarlsnickarls Registered Users Posts: 1 Beginner grinner
Is there some way of getting all the albums in a category without iterating through all the albums using the REST API and checking the category?

Comments

  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited October 4, 2006
    nickarls wrote:
    Is there some way of getting all the albums in a category without iterating through all the albums using the REST API and checking the category?

    Hi Nick,

    You could use smugmug.users.getTree, which returns the full list of categories and associated subcategories and albums.

    I am going to raise an enhancement request to include an optional category parameter to return only a partial branch of the tree.

    Until then, perhaps getting the whole tree will suffice.

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • TazzyTazzyTazzyTazzy Registered Users Posts: 32 Big grins
    edited October 4, 2006
    Method not found....
    Mod Edit: Logged as SmugBug

    [ErrorMsg] => server error. method not found.

    smugmug.users.getTree

    ne_nau.gif
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited October 4, 2006
    TazzyTazzy wrote:
    [ErrorMsg] => server error. method not found.

    smugmug.users.getTree

    ne_nau.gif

    lol3.giflol3.gif

    sorry it's a beta method, make sure u use version 1.1.1
    David Parry
    SmugMug API Developer
    My Photos
  • TazzyTazzyTazzyTazzy Registered Users Posts: 32 Big grins
    edited October 5, 2006
    devbobo wrote:
    lol3.giflol3.gif

    sorry it's a beta method, make sure u use version 1.1.1
    I'm fairly sure I'm using 1.1.1... Here's some PHP...
          $login_struct = array(
             new xmlrpcval(variable_get('smugmug_email','')),
             new xmlrpcval($pass),
             new xmlrpcval('1.1.1'),
             new xmlrpcval( $api_key ));
    
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited October 5, 2006
    TazzyTazzy wrote:
    I'm fairly sure I'm using 1.1.1... Here's some PHP...
          $login_struct = array(
             new xmlrpcval(variable_get('smugmug_email','')),
             new xmlrpcval($pass),
             new xmlrpcval('1.1.1'),
             new xmlrpcval( $api_key ));
    

    Tazzy,

    Passing the version like that is depreciated now with latest release.

    You should be using this endpoint instead...

    http://api.smugmug.com/hack/xmlrpc/1.1.1/

    so versions will now be denoted by the url, not a parameter being passed with login.


    more info here

    Please note, that I haven't had a chance to test the new release of the API with xml-rpc.

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • TazzyTazzyTazzyTazzy Registered Users Posts: 32 Big grins
    edited October 9, 2006
    devbobo wrote:
    Tazzy,

    Passing the version like that is depreciated now with latest release.

    You should be using this endpoint instead...

    http://api.smugmug.com/hack/xmlrpc/1.1.1/

    I am.. Still no go..

    $smugmug_client = new xmlrpc_client("/hack/xmlrpc/1.1.1/", "api.smugmug.com", "443");

    ....Wishing I could get this to work...

    -Mitch
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited October 9, 2006
    TazzyTazzy wrote:
    I am.. Still no go..

    $smugmug_client = new xmlrpc_client("/hack/xmlrpc/1.1.1/", "api.smugmug.com", "443");

    ....Wishing I could get this to work...

    -Mitch

    Hi Tazzy,

    I started building my API test harness last night, I have confirmed your problem. It has been logged as a SmugBug, so hopefully it will get looked at soonish.

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • claudermilkclaudermilk Registered Users Posts: 2,756 Major grins
    edited October 11, 2006
    So when it does return values, does GetTree return good data? In helping another user debug a call to that routine, I saw the XML returned is all borked up & not usable; cat & subcat info did not match the image it was returned with IIRC.
  • mhilbushmhilbush Registered Users Posts: 70 Big grins
    edited October 11, 2006
    So when it does return values, does GetTree return good data? In helping another user debug a call to that routine, I saw the XML returned is all borked up & not usable; cat & subcat info did not match the image it was returned with IIRC.
    Yes, this latest version returns very usable results.
    Mark
    Mark
  • claudermilkclaudermilk Registered Users Posts: 2,756 Major grins
    edited October 12, 2006
  • StardogStardog Registered Users Posts: 15 Big grins
    edited October 13, 2006
    mhilbush wrote:
    Yes, this latest version returns very usable results.
    Mark

    I assume you are reffering to the REST version? I still get method not found with XML-RPC.
  • mhilbushmhilbush Registered Users Posts: 70 Big grins
    edited October 13, 2006
    Yes, I was referring to the REST version.
    Mark
    Mark
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited November 17, 2006
    Fixed in API release 1.1.1 17/11/2006
    David Parry
    SmugMug API Developer
    My Photos
Sign In or Register to comment.