Added by David Parry, last edited by David Parry on Feb 11, 2008  (view change)

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.

smugmug.login.withPassword

Establishes a session and logs a user in based on the specified email address (or nickname) and password.

Note: For security reasons, this method should only be sent over SSL.

Arguments

  • string APIKey
  • string EmailAddress
  • string Password

Result

  • struct Login
    • struct Session
      • string id
    • struct User
      • integer id
      • string NickName
      • string DisplayName
    • string PasswordHash
    • string AccountType
    • integer FileSizeLimit

Fault Codes

  • 1 - "invalid login"
  • 5 - "system error"
  • 11 - "ancient version"
  • 18 - "invalid API key"

Sample Requests

XML-RPC

Sample Responses

REST

JSON

PHP

XML-RPC

Code Samples

PHP using REST

PERL using JSON

The response struct as listed up top is not the same as the response actually uses.  Check the samples to confirm the correct order.

Comment: Posted by Anonymous at Feb 11, 2008 19:28

Hi..I am new to using the API and I keep the getting the syntax error

nickName = document.getElementById("userName").value;
password = document.getElementById("password").value;
scriptObj = document.createElement("script");
scriptObj.src = "http://api.smugmug.com/hack/json/1.2.0/?method=smugmug.login.withPassword&EmailAddress=" + nickName + "&Password=" + password + "&APIKey=0viok3cza2GTAhkImL8k4OvHY6NjarEK&callback=showFeed";
scriptObj.type = "text/javascript";
document.getElementsByTagName("head")[0].appendChild(scriptObj);

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 3.5.21022; MS-RTC LM 8; .NET CLR 3.5.30729; .NET CLR 3.0.30618)
Timestamp: Fri, 26 Jun 2009 20:58:43 UTC

Message: Syntax error
Line: 1
Char: 1
Code: 0
URI: http://api.smugmug.com/hack/rest/1.2.0/?method=smugmug.login.withPassword&EmailAddress=sboora&Password=hyderabad&APIKey=0viok3cza2GTAhkImL8k4OvHY6NjarEK

Thanks for the help...

Comment: Posted by Anonymous at Jun 26, 2009 15:59