XML-RPC API key doesn't work for JSON
Nikolai
Registered Users Posts: 19,035 Major grins
I'm trying to upgrade from xml-rpc 1.1.1 to json 1.2.x.
Unfortunately, the json login returns fault 18 "invalid API key".:scratch
At the same time existing rpc-xml with the same key works fine.
Key shows as active in my SM control panel, too.
:dunno
Unfortunately, the json login returns fault 18 "invalid API key".:scratch
At the same time existing rpc-xml with the same key works fine.
Key shows as active in my SM control panel, too.
:dunno
"May the f/stop be with you!"
0
Comments
please post your request structure, thanks
SmugMug API Developer
My Photos
and here it is, also:
Here's my POST request:
URL: https://api.smugmug.com/hack/json/1.2.0/?method=smugmug.login.withPassword (I tried 1.2.1 url, too, same result)
BODY: {"EmailAddress":"-my email-","Password":"-my password-","APIKey":"-my api key copy pasted from working code -"}
I recieve the following response
{"stat":"fail","code":18,"message":"invalid API key"}
Don't do a post, just do a get like this...
https://api.smugmug.com/hack/json/1.2.0/?method=smugmug.login.withPassword&EmailAddress=xxx&Password=yyy&APIKey=zzzz
Cheers,
David
SmugMug API Developer
My Photos
Now I'm confused - do all the json methods work like that, or only the login ones? I thought this more like REST type of info passing... API section of the wiki doesn't say a word about this...
all methods except xml-rpc pass parameters like this. We may support posting json at some point in the future but not now.
SmugMug API Developer
My Photos
I guess, serializing into json wouldn't do me any good then...
Does it also mean that no matter how request parameters are "structured" in doc, they are always presented in a "flat" url like:
uri?param1¶m2&...param999
you'd have to give me a specific example...but yes all requests for non xml-rpc methods are like this.
SmugMug API Developer
My Photos