getAlbumInfo returns null content string. Why?

tk421tk421 Registered Users Posts: 6 Beginner grinner
Hi folks,

I'm trying to write a perl script to access my smugmug account via the XML-RPC API. I have been able to login and get a list of albums, but when I try iterating over the albums calling getAlbumInfo, the response has a null content string. As a result, the XML parser dies.

Any ideas as to why the response would have a blank content string? I would have thought that, had I messed something up, it would return an error string.

I've added the snippet of code, below, up to the point where I get the invalid response. Any feedback you might have is greatly appreciated.

Thanks,
Bryan


use Frontier::Client;

my $url = "https://upload.smugmug.com/xmlrpc/";
my $username = 'INSERT_YOUR_NAME_HERE';
my $password = 'INSERT_YOUR_PASSWORD_HERE';

my $client = Frontier::Client->new(url => $url, debug => 0, );

print "Attempting to log in...\n";
my $result = $client->call('loginWithPassword', $username, $password);

my $SessionID = $result->{SessionID};

print "Session ID is: $SessionID\n";
print "Trying to get albums\n";

my $albums = $client->call('getAlbums', $SessionID);

print "Found ", scalar(@$albums), " album(s)\n";

foreach my $album (@$albums)
{
my $AlbumID = $album->{AlbumID};
print "Looking at album '", $album->{Title}, "' ($AlbumID)\n";

print "Getting album info\n";
my $album_info = $client->call('getAlbumInfo', $SessionID, $AlbumID);

Comments

  • tk421tk421 Registered Users Posts: 6 Beginner grinner
    edited January 7, 2005
    related issue?
    Incidentally, if I replace the final two lines of:

    print "Getting album info\n";
    my $album_info = $client->call('getAlbumInfo', $SessionID, $AlbumID);

    with

    print "Getting image info\n";
    my $images = $client->call('getImages', $SessionID, $AlbumID);

    I get a fault code 4: invalid user, instead of a blank content line. So, still a problem, but not as harsh. :)
  • tk421tk421 Registered Users Posts: 6 Beginner grinner
    edited January 13, 2005
    Anyone? Does anybody know?
  • NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited January 13, 2005
    I didn't get to those yet..
    tk421 wrote:
    Anyone? Does anybody know?
    .. and, frankly speaking, until the initial (very basic and limited) set of API is fixed and brought up to date with all those recently introduced features, I'm not going to..
    Just my $.02

    Cheers!1drink.gif
    "May the f/stop be with you!"
Sign In or Register to comment.