No login method using XMLRPC with v1.2.2 API
tullmann
Registered Users Posts: 11 Big grins
I'm using Python with the XMLRPC API. I have code that mostly works with v1.2.1. I'm trying to see if upgrading to v1.2.2 fixes some session management problems, but I can't even invoke "smugmug.login.withPassword" against the 1.2.2 API. I get:
<methodResponse><fault><value><struct><member><name>faultString</name><value><string>server error. method not found.\n\nsmugmug.login.withPassword</string></value></member><member><name>faultCode</name><value><int>-32601</int></value></member></struct></value></fault></methodResponse>
I'm using https://secure.smugmug.com/services/api/xmlrpc/1.2.2/ (api.smugmug.com doesn't work either). I'm happy to paste in the 20-line Python script that demonstrates this if that helps.
Anyone having success with XMLRPC v1.2.2?
<methodResponse><fault><value><struct><member><name>faultString</name><value><string>server error. method not found.\n\nsmugmug.login.withPassword</string></value></member><member><name>faultCode</name><value><int>-32601</int></value></member></struct></value></fault></methodResponse>
I'm using https://secure.smugmug.com/services/api/xmlrpc/1.2.2/ (api.smugmug.com doesn't work either). I'm happy to paste in the 20-line Python script that demonstrates this if that helps.
Anyone having success with XMLRPC v1.2.2?
0
Comments
Thanks,
David
SmugMug API Developer
My Photos
#!/usr/bin/python
#
# v1.2.2 XMLRPC test for smugmug.login.withPassword
import sys
import httplib
import xmlrpclib
API_KEY="xxx"
if len(sys.argv) < 3:
print("test-v1.2.2.py <username> <password>")
sys.exit(1)
verbose=True
# v1.2.1 works:
client1 = xmlrpclib.ServerProxy("https://api.smugmug.com/services/api/xmlrpc/1.2.1/", verbose=verbose)
session = client1.smugmug.login.withPassword(sys.argv[1], sys.argv[2], API_KEY)
# v1.2.2 does not work:
#client2 = xmlrpclib.ServerProxy("https://api.smugmug.com/services/api/xmlrpc/1.2.2/", verbose=verbose)
#client2 = xmlrpclib.ServerProxy("http://api.smugmug.com/services/api/xmlrpc/1.2.2/", verbose=verbose)
#client2 = xmlrpclib.ServerProxy("http://secure.smugmug.com/services/api/xmlrpc/1.2.2/", verbose=verbose)
client2 = xmlrpclib.ServerProxy("https://secure.smugmug.com/services/api/xmlrpc/1.2.2/", verbose=verbose)
print str(client2)
session = client2.smugmug.login.withPassword(API_KEY, sys.argv[1], sys.argv[2])
print session
#eof
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Good eye. I was fiddling around with this and noticed the new doc has the API key as the first parameter. However, I haven't gotten far enough for it to do a parameter check and reject the call. I'm getting a fault that smugmug.login.withPassword doesn't even exist as a method. (That said, I've tried the the other order too, in case XMLRPC doesn't work like I think.)
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
SmugMug API Developer
My Photos
Do you have example XML of a named parameter call in XML-RPC? AFAICT, they're not supported by the protocol (I'm looking at http://www.xmlrpc.com/spec).
We've been meaning to switch to json since it looks far more sane than XMLRPC, but its been easier to just tweak the existing code base. Perhaps this will be sufficient motivation.
Thanks!
session = client2.smugmug.login.withPassword({"APIKey": API_KEY, "EmailAddress": sys.argv[1], "Password": sys.argv[2]})
Cheers,
David
SmugMug API Developer
My Photos
Thanks David, that works. Shouldn't be too hard to switch our calls from list-of-parameters to dict-of-parameters.