Options

Bug: Are UserIDs strings or ints?

luke_churchluke_church Registered Users Posts: 507 Major grins
Bug location: smugmug.login.withPassword (possible documentation bug)

Issue: Documentation and actual server response are contradictory.

Documentation indicates structure returns a string

http://www.smugmug.com/hack/method-smugmug.login.withPassword

struct
  • String "SessionID"
  • String "UserID"
  • String "PasswordHash"
XML comms with server indicates that an int is required:

[php]
Header
<?xml version="1.0"?>
<methodCall>
<methodName>smugmug.login.withPassword</methodName>
<params>
<param>
<value>
<string>smugtest@polymorphix.net</string>
</value>
</param>
<param>
<value>
<string>...</string>
</value>
</param>
<param>
<value>
<string>1.1.0</string>
</value>
</param>
<param>
<value>
<string>...</string>
</value>
</param>
</params>
</methodCall>
Header
<?xml version="1.0" encoding="iso-8859-1"?>
<methodResponse>
<params>
<param>
<value>
<struct>
<member>
<name>SessionID</name>
<value>
<string>...</string>
</value>
</member>
<member>
<name>UserID</name>
<value>
<int>39179</int>
</value>
</member>
<member>
<name>PasswordHash</name>
<value>
<string>...</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodResponse>








[/php]

Inspection of previous code indicates:

Use int in 'credentials structure', when using LoginWithHash, convert into to string before passing.

Current work-around implemention:

Use int in Credentials structure, convert to string everywhere else.

Cheers,

Luke

Comments

Sign In or Register to comment.