XML-RPC API key doesn't work for JSON

NikolaiNikolai 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
"May the f/stop be with you!"

Comments

  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited February 17, 2008
    Nikolai wrote:
    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".headscratch.gif
    At the same time existing rpc-xml with the same key works fine.
    Key shows as active in my SM control panel, too.
    ne_nau.gif

    please post your request structure, thanks
    David Parry
    SmugMug API Developer
    My Photos
  • NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited February 17, 2008
    devbobo wrote:
    please post your request structure, thanks
    it's in your email, man..:-)

    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"}
    "May the f/stop be with you!"
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited February 17, 2008
    David Parry
    SmugMug API Developer
    My Photos
  • NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited February 17, 2008
    devbobo wrote:
    Yay! Thanks!
    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...headscratch.gif
    "May the f/stop be with you!"
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited February 18, 2008
    Nikolai wrote:
    Yay! Thanks!
    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...headscratch.gif

    all methods except xml-rpc pass parameters like this. We may support posting json at some point in the future but not now. thumb.gif
    David Parry
    SmugMug API Developer
    My Photos
  • NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited February 18, 2008
    devbobo wrote:
    all methods except xml-rpc pass parameters like this. We may support posting json at some point in the future but not now. thumb.gif
    Really? Well, that's news for me...Thanks for letting me know!
    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&param2&...param999 headscratch.gif
    "May the f/stop be with you!"
  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited February 18, 2008
    Nikolai wrote:
    Really? Well, that's news for me...Thanks for letting me know!
    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&param2&...param999 headscratch.gif

    you'd have to give me a specific example...but yes all requests for non xml-rpc methods are like this.
    David Parry
    SmugMug API Developer
    My Photos
  • NikolaiNikolai Registered Users Posts: 19,035 Major grins
    edited February 18, 2008
    devbobo wrote:
    you'd have to give me a specific example...but yes all requests for non xml-rpc methods are like this.
    OK. I will play along and if somehting doesn't work I'll ask :-)
    "May the f/stop be with you!"
Sign In or Register to comment.