WWW::SmugMug::API - Perl wrapper for the SmugMug API
Version 1.02
use WWW::SmugMug::API; my $sm_api = WWW::SmugMug::API->new( { sm_api_key => 'changeme', secure => 1, } ); $sm_api->login_withPassword( { EmailAddress => 'me@privacy.net', Password => 'password', } ); ... $sm_api->logout;
Provides a low-level wrapper for the 1.2.0 version of the SmugMug API. Calls requiring a SessionID use the one returned from the last successful login call (login_anonymously, login_withPassword, or login_withHash), and calls requiring the API key use the sm_api_key parameter passed to the constructor; these provided parameters cannot be overridden. All other required parameters must be provided by the caller.
The wrapper will silently discard any parameters that it does not recognise.
Method names are the API methods with the 'smugmug.' prefix removed and '_' substituted for '.' (e.g. 'smugmug.login.withPassword becomes login_withPassword())
Methods return hash references. The value of the 'stat' key will be 'ok' if the call succeeded, 'fail' otherwise. Fail responses contain three key/value pairs: 'stat', 'message', and 'code'. Message is an informative message about the failure. The code will be positive for an error thrown by SmugMug and negative for one from the wrapper. The following error codes are known:
Session not initialised. Before calling any other methods, you must successfully call login_anonymously, login_withPassword, or login_withHash.
HTTP error. Message will be the complete error (e.g. '404 Not Found')
Missing required parameter. All parameters listed in the documentation as required must be provided, or the wrapper will reject the call.
Invalid login.
Invalid session.
Invalid user.
System error.
Wrong format. (Image format when uploading, I believe)
Invalid album.
Ancient version.
Empty set.
Invalid API key.
NOTE: While this wrapper does provide a method called images_upload, per the best practices recommendation of the SmugMug developers we use a binary uploading method (HTTP PUT) to upload the image; it is not an implementation of the API method smugmug.images.upload. images_uploadFromURL is not provided.
Create a new client object. Parameters:
API key
Useragent string.
Set this to 1 to use SSL. Defaults to 0
1
0
Time (in seconds) to wait for a response. Defaults to 30.
Set this to 1 to retry on error. Defaults to 0
Calls smugmug.albums.applyWatermark.
Parameters:
Calls smugmug.albums.changeSettings.
Calls smugmug.albums.create.
Calls smugmug.albums.delete.
Calls smugmug.albums.get.
Calls smugmug.albums.getInfo.
Calls smugmug.albums.getStats.
Calls smugmug.albums.removeWatermark.
Calls smugmug.albums.reSort.
Calls smugmug.albumtemplates.changeSettings.
Calls smugmug.albumtemplates.create.
Calls smugmug.albumtemplates.get.
No parameters
Calls smugmug.categories.create.
Calls smugmug.categories.delete.
Calls smugmug.categories.get.
Calls smugmug.categories.rename.
Calls smugmug.family.add.
Calls smugmug.family.get.
Calls smugmug.family.remove.
Calls smugmug.family.removeAll.
Calls smugmug.friends.add.
Calls smugmug.friends.get.
Calls smugmug.friends.remove.
Calls smugmug.friends.removeAll.
Calls smugmug.images.applyWatermark.
Calls smugmug.images.changePosition.
Calls smugmug.images.changeSettings.
Calls smugmug.images.crop.
Calls smugmug.images.delete.
Calls smugmug.images.get.
Calls smugmug.images.getEXIF.
Calls smugmug.images.getInfo.
Calls smugmug.images.getStats.
Calls smugmug.images.getURLs.
Calls smugmug.images.removeWatermark.
Calls smugmug.images.rotate.
Calls smugmug.images.zoomThumbnail.
Calls smugmug.login.anonymously.
Calls smugmug.login.withHash.
Calls smugmug.login.withPassword.
Calls smugmug.logout.
Calls smugmug.products.get.
Calls smugmug.propricing.getPortfolio.
Calls smugmug.propricing.getAlbum.
Calls smugmug.propricing.getImage.
Calls smugmug.sharegroups.addAlbum.
Calls smugmug.sharegroups.create.
Calls smugmug.sharegroups.delete.
Calls smugmug.sharegroups.get.
Calls smugmug.sharegroups.getInfo.
Calls smugmug.sharegroups.removeAlbum.
Calls smugmug.subcategories.create.
Calls smugmug.subcategories.delete.
Calls smugmug.subcategories.get.
Calls smugmug.subcategories.getAll.
Calls smugmug.subcategories.rename.
Calls smugmug.themes.get.
Calls smugmug.users.getDisplayName.
Calls smugmug.users.getTransferStats.
Calls smugmug.users.getTree.
Calls smugmug.watermarks.changeSettings.
Calls smugmug.watermarks.create.
Calls smugmug.watermarks.delete.
Calls smugmug.watermarks.get.
Calls smugmug.watermarks.getInfo.
Returns the currently cached SessionID.
Uploads an image.
This section intentionally left blank.
WWW::SmugMUG::API requires no special configuration or environment variables.
JSON LWP::UserAgent
No known incompatibilities.
No known bugs.
You can find documentation for this module with the perldoc command.
perldoc WWW::SmugMug::API
Paul Arthur, <flowerysong00 at yahoo.com>
<flowerysong00 at yahoo.com>
Copyright 2008-2010 Paul Arthur MacIain, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
9 POD Errors
The following errors were encountered while parsing the POD:
Expected text after =item, not a number
To install WWW::SmugMug::API, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::SmugMug::API
CPAN shell
perl -MCPAN -e shell install WWW::SmugMug::API
For more information on module installation, please visit the detailed CPAN module installation guide.