API Method: smugmug.login.withPassword
This method establishes a session and logs a user in based on the specified email address and password.
NOTE: This is a plaintext password, and thus, should only be sent via SSL.
Most of the other methods require a SessionID, which is returned by
this method. Store temporarily and re-use it for all other methods
which require SessionID.
Arguments:
- EmailAddress
- Password
- APIKey
Result:
- struct
- String "SessionID"
- String "UserID"?
- String "NickName"?
- String "DisplayName"
- String "PasswordHash"
- String "AccountType"
- int "FileSizeLimit"
Fault Codes:
- 1 - "invalid login"
- 5 - "system error"
- 11 - "ancient version"
Using REST from PHP Example:
<?php
$base = 'https://api.smugmug.com/hack/rest/1.1.1/';
$query_string = '';
$params = array(
'method' => "smugmug.login.withPassword",
'EmailAddress' => 'YourSmugmugNickName',
'Password' => 'YourSmugmugPassword',
'APIKey' => 'YourSmugmugAPIKey'
);
foreach ($params as $key => $value) {
$query_string .= "$key=" . urlencode($value) . "&";
}
$url = "$base?$query_string";
$xml = file_get_contents($url);
echo "$xml\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n";
?>