1.2.0 incorrect return codes
rkalla
Registered Users Posts: 108 Major grins
It's possible I am misunderstanding the API, but I noticed some unexpected return codes with the following API calls:
logout = Never returns 3/invalid session. Whenever an invalid session is given, instead 18/invalid API Key is returned instead, even if the key is correct.
getTree = Same problem as logout above, invalid user is never returned. If an invalid SessionID or NickName is given, the call always returns 18/invalid API Key (even when the key is correct).
logout = Never returns 3/invalid session. Whenever an invalid session is given, instead 18/invalid API Key is returned instead, even if the key is correct.
getTree = Same problem as logout above, invalid user is never returned. If an invalid SessionID or NickName is given, the call always returns 18/invalid API Key (even when the key is correct).
0
Comments
kallasoft | The "Break It Down" Blog
It's because API Key is tied to a session...so when we try to restore an invalid session, there is no API Key. Hence the reason for that error message. I will check with Don to see if we can do it a different way.
Can you try smugmug.users.getTree again...with a vaild session id and invalid nickname, I am pretty sure that you will get invalid user as the error message.
Cheers,
David
SmugMug API Developer
My Photos
You are spot-on that worked (valid SID, invalid Nick).
I think this is just a case of me getting confused by the wording of the API (http://smugmug.jot.com/WikiHome/1.2.0/smugmug.users.getTree) seems to suggest SID or NickName can be used to lookup the records... I've noticed that with a few other API calls that support NickName...
but from the sound of it, you cannot lookup anything without a valid SessionID... in which case the NickName isn't really useful is it? (If it is, should the wording of the doc be updated? I'll offer to update it once I understand)
kallasoft | The "Break It Down" Blog
If you are logged with a session (not an anonymous session), calling smugmug.users.getTree without the NickName will return your own tree. By supplying the NickName of another SmugMug user, you can retrieve their public tree.
If you are logged in with anonymous session, NickName is required for any method that supports it.
SmugMug API Developer
My Photos
Thank you for the clarification. It does indeed sound very helpful now
kallasoft | The "Break It Down" Blog