NAME
WWW::SmugMug::API - Perl wrapper for the SmugMug API
VERSION
Version 1.02
SYNOPSIS
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;
DESCRIPTION
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:
- -3
-
Session not initialised. Before calling any other methods, you must successfully call login_anonymously, login_withPassword, or login_withHash.
- -2
-
HTTP error. Message will be the complete error (e.g. '404 Not Found')
- -1
-
Missing required parameter. All parameters listed in the documentation as required must be provided, or the wrapper will reject the call.
- 1
-
Invalid login.
- 3
-
Invalid session.
- 4
-
Invalid user.
- 5
-
System error.
- 6
-
Wrong format. (Image format when uploading, I believe)
- 9
-
Invalid album.
- 11
-
Ancient version.
- 15
-
Empty set.
- 18
-
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.
SUBROUTINES/METHODS
new
Create a new client object. Parameters:
- sm_api_key
-
API key
- agent
-
Useragent string.
- secure
-
Set this to
1
to use SSL. Defaults to0
- timeout
-
Time (in seconds) to wait for a response. Defaults to 30.
- retry
-
Set this to
1
to retry on error. Defaults to0
albums_applyWatermark
Calls smugmug.albums.applyWatermark.
Parameters:
albums_changeSettings
Calls smugmug.albums.changeSettings.
Parameters:
- AlbumID (integer) (required)
- Title (string)
- CategoryID (integer)
- SubCategoryID (integer)
- Description (string)
- Keywords (string)
- AlbumTemplateID (integer)
- Geography (boolean)
- HighlightID (integer)
- Position (integer)
- Header (boolean)
- Clean (boolean)
- EXIF (boolean)
- Filenames (boolean)
- SquareThumbs (boolean)
- TemplateID (integer)
- SortMethod (string)
- SortDirection (boolean)
- Password (string)
- PasswordHint (string)
- Public (boolean)
- WorldSearchable (boolean)
- SmugSearchable (boolean)
- External (boolean)
- Protected (boolean)
- Watermarking (boolean)
- WatermarkID (integer)
- HideOwner (boolean)
- Larges (boolean)
- XLarges (boolean)
- X2Larges (boolean)
- X3Larges (boolean)
- Originals (boolean)
- CanRank (boolean)
- FriendEdit (boolean)
- FamilyEdit (boolean)
- Comments (boolean)
- Printable (boolean)
- DefaultColor (boolean)
- ProofDays (integer)
- Backprinting (string)
- UnsharpAmount (float)
- UnsharpRadius (float)
- UnsharpThreshold (float)
- UnsharpSigma (float)
- CommunityID (integer)
albums_create
Calls smugmug.albums.create.
Parameters:
- Title (string) (required)
- CategoryID (string) (required)
- SubCategoryID (integer)
- Description (string)
- Keywords (string)
- AlbumTemplateID (integer)
- Geography (boolean)
- HighlightID (integer)
- Position (integer)
- Header (boolean)
- Clean (boolean)
- EXIF (boolean)
- Filenames (boolean)
- SquareThumbs (boolean)
- TemplateID (integer)
- SortMethod (string)
- SortDirection (boolean)
- Password (string)
- PasswordHint (string)
- Public (boolean)
- WorldSearchable (boolean)
- SmugSearchable (boolean)
- External (boolean)
- Protected (boolean)
- Watermarking (boolean)
- WatermarkID (integer)
- HideOwner (boolean)
- Larges (boolean)
- XLarges (boolean)
- X2Larges (boolean)
- X3Larges (boolean)
- Originals (boolean)
- CanRank (boolean)
- FriendEdit (boolean)
- FamilyEdit (boolean)
- Comments (boolean)
- Printable (boolean)
- DefaultColor (boolean)
- ProofDays (integer)
- Backprinting (string)
- UnsharpAmount (float)
- UnsharpRadius (float)
- UnsharpThreshold (float)
- UnsharpSigma (float)
- CommunityID (integer)
albums_delete
Calls smugmug.albums.delete.
Parameters:
albums_get
Calls smugmug.albums.get.
Parameters:
albums_getInfo
Calls smugmug.albums.getInfo.
Parameters:
albums_getStats
Calls smugmug.albums.getStats.
Parameters:
albums_removeWatermark
Calls smugmug.albums.removeWatermark.
Parameters:
albums_reSort
Calls smugmug.albums.reSort.
Parameters:
albumtemplates_changeSettings
Calls smugmug.albumtemplates.changeSettings.
Parameters:
- AlbumTemplateID (integer) (required)
- Name (string)
- HighlightID (integer)
- SortMethod (string)
- SortDirection (boolean)
- Public (boolean)
- Password (string)
- PasswordHint (string)
- Printable (boolean)
- Filenames (boolean)
- Comments (boolean)
- External (boolean)
- Originals (boolean)
- EXIF (boolean)
- Header (boolean)
- Larges (boolean)
- XLarges (boolean)
- X2Larges (boolean)
- X3Larges (boolean)
- Clean (boolean)
- Protected (boolean)
- Watermarking (boolean)
- FamilyEdit (boolean)
- FriendEdit (boolean)
- HideOwner (boolean)
- DefaultColor (boolean)
- Geography (boolean)
- CanRank (boolean)
- ProofDays (integer)
- Backprinting (string)
- SmugSearchable (boolean)
- UnsharpAmount (float)
- UnsharpRadius (float)
- UnsharpThreshold (float)
- UnsharpSigma (float)
- WorldSearchable (boolean)
- TemplateID (integer)
- CommunityID (integer)
- WatermarkID (integer)
albumtemplates_create
Calls smugmug.albumtemplates.create.
Parameters:
- Name (string)
- HighlightID (integer)
- SortMethod (string)
- SortDirection (boolean)
- Public (boolean)
- Password (string)
- PasswordHint (string)
- Printable (boolean)
- Filenames (boolean)
- Comments (boolean)
- External (boolean)
- Originals (boolean)
- EXIF (boolean)
- Header (boolean)
- Larges (boolean)
- XLarges (boolean)
- X2Larges (boolean)
- X3Larges (boolean)
- Clean (boolean)
- Protected (boolean)
- Watermarking (boolean)
- FamilyEdit (boolean)
- FriendEdit (boolean)
- HideOwner (boolean)
- DefaultColor (boolean)
- Geography (boolean)
- CanRank (boolean)
- ProofDays (integer)
- Backprinting (string)
- SmugSearchable (boolean)
- UnsharpAmount (float)
- UnsharpRadius (float)
- UnsharpThreshold (float)
- UnsharpSigma (float)
- WorldSearchable (boolean)
- TemplateID (integer)
- CommunityID (integer)
- WatermarkID (integer)
albumtemplates_get
Calls smugmug.albumtemplates.get.
Parameters:
No parameters
categories_create
Calls smugmug.categories.create.
Parameters:
categories_delete
Calls smugmug.categories.delete.
Parameters:
categories_get
Calls smugmug.categories.get.
Parameters:
categories_rename
Calls smugmug.categories.rename.
Parameters:
family_add
Calls smugmug.family.add.
Parameters:
family_get
Calls smugmug.family.get.
Parameters:
No parameters
family_remove
Calls smugmug.family.remove.
Parameters:
family_removeAll
Calls smugmug.family.removeAll.
Parameters:
No parameters
friends_add
Calls smugmug.friends.add.
Parameters:
friends_get
Calls smugmug.friends.get.
Parameters:
No parameters
friends_remove
Calls smugmug.friends.remove.
Parameters:
friends_removeAll
Calls smugmug.friends.removeAll.
Parameters:
No parameters
images_applyWatermark
Calls smugmug.images.applyWatermark.
Parameters:
images_changePosition
Calls smugmug.images.changePosition.
Parameters:
images_changeSettings
Calls smugmug.images.changeSettings.
Parameters:
images_crop
Calls smugmug.images.crop.
Parameters:
- ImageID (integer) (required)
- Width (integer) (required)
- Height (integer) (required)
- X (integer) (required)
- Y (integer) (required)
images_delete
Calls smugmug.images.delete.
Parameters:
images_get
Calls smugmug.images.get.
Parameters:
- AlbumID (integer) (required)
- Heavy (boolean)
- Password (string)
- SitePassword (string)
- AlbumKey (string) (required)
images_getEXIF
Calls smugmug.images.getEXIF.
Parameters:
images_getInfo
Calls smugmug.images.getInfo.
Parameters:
images_getStats
Calls smugmug.images.getStats.
Parameters:
images_getURLs
Calls smugmug.images.getURLs.
Parameters:
- ImageID (integer) (required)
- TemplateID (integer)
- Password (string)
- SitePassword (string)
- ImageKey (string)
images_removeWatermark
Calls smugmug.images.removeWatermark.
Parameters:
images_rotate
Calls smugmug.images.rotate.
Parameters:
images_zoomThumbnail
Calls smugmug.images.zoomThumbnail.
Parameters:
- ImageID (integer) (required)
- Width (integer) (required)
- Height (integer) (required)
- X (integer) (required)
- Y (integer) (required)
login_anonymously
Calls smugmug.login.anonymously.
Parameters:
No parameters
login_withHash
Calls smugmug.login.withHash.
Parameters:
login_withPassword
Calls smugmug.login.withPassword.
Parameters:
logout
Calls smugmug.logout.
Parameters:
No parameters
products_get
Calls smugmug.products.get.
Parameters:
No parameters
propricing_getPortfolio
Calls smugmug.propricing.getPortfolio.
Parameters:
propricing_getAlbum
Calls smugmug.propricing.getAlbum.
Parameters:
propricing_getImage
Calls smugmug.propricing.getImage.
Parameters:
sharegroups_addAlbum
Calls smugmug.sharegroups.addAlbum.
Parameters:
sharegroups_create
Calls smugmug.sharegroups.create.
Parameters:
sharegroups_delete
Calls smugmug.sharegroups.delete.
Parameters:
sharegroups_get
Calls smugmug.sharegroups.get.
Parameters:
sharegroups_getInfo
Calls smugmug.sharegroups.getInfo.
Parameters:
sharegroups_removeAlbum
Calls smugmug.sharegroups.removeAlbum.
Parameters:
subcategories_create
Calls smugmug.subcategories.create.
Parameters:
subcategories_delete
Calls smugmug.subcategories.delete.
Parameters:
subcategories_get
Calls smugmug.subcategories.get.
Parameters:
subcategories_getAll
Calls smugmug.subcategories.getAll.
Parameters:
subcategories_rename
Calls smugmug.subcategories.rename.
Parameters:
themes_get
Calls smugmug.themes.get.
Parameters:
No parameters
users_getDisplayName
Calls smugmug.users.getDisplayName.
Parameters:
users_getTransferStats
Calls smugmug.users.getTransferStats.
Parameters:
users_getTree
Calls smugmug.users.getTree.
Parameters:
watermarks_changeSettings
Calls smugmug.watermarks.changeSettings.
Parameters:
watermarks_create
Calls smugmug.watermarks.create.
Parameters:
watermarks_delete
Calls smugmug.watermarks.delete.
Parameters:
watermarks_get
Calls smugmug.watermarks.get.
Parameters:
watermarks_getInfo
Calls smugmug.watermarks.getInfo.
Parameters:
getSessionID
Returns the currently cached SessionID.
Parameters:
No parameters
images_upload
Uploads an image.
Parameters:
- ImageData (binary) (required)
- FileName (string) (required)
- AlbumID (integer)
- ImageID (integer)
- Caption (string)
- Keywords (string)
- Latitude (float?)
- Longitude (float?)
- Altitude (integer?)
DIAGNOSTICS
This section intentionally left blank.
CONFIGURATION AND ENVIRONMENT
WWW::SmugMUG::API requires no special configuration or environment variables.
DEPENDENCIES
JSON LWP::UserAgent
INCOMPATIBILITIES
No known incompatibilities.
BUGS AND LIMITATIONS
No known bugs.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc WWW::SmugMug::API
AUTHOR
Paul Arthur, <flowerysong00 at yahoo.com>
ACKNOWLEDGEMENTS
This section intentionally left blank.
LICENSE AND COPYRIGHT
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:
- Around line 75:
Expected text after =item, not a number
- Around line 79:
Expected text after =item, not a number
- Around line 83:
Expected text after =item, not a number
- Around line 87:
Expected text after =item, not a number
- Around line 91:
Expected text after =item, not a number
- Around line 95:
Expected text after =item, not a number
- Around line 99:
Expected text after =item, not a number
- Around line 103:
Expected text after =item, not a number
- Around line 107:
Expected text after =item, not a number