Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

i guess you're wink api support! #4

Closed
mrose17 opened this Issue · 10 comments

3 participants

@mrose17

here's what i'm sending in the post for /oauth2/token

{"client_id":"...","client_secret":"...","username":"mrose17@gmail.com","password":"...","grant_type":"password","base_url":"https://winkapi.quirky.com"}

and here's what i get back:

{"data":{"error":"unsupported_grant_type"},"errors":[],"pagination":{}}

eh? i've looked at your code and you're sending password as well. am i missing the obvious?

@jso
Owner
jso commented
@mrose17

thanks. i removed base_url, and verified the headers:

    { protocol: 'https:',
      slashes: true,
      auth: null,
      host: 'winkapi.quirky.com',
      port: null,
      hostname: 'winkapi.quirky.com',
      hash: null,
      search: null,
      query: null,
      pathname: '/oauth2/token',
      path: '/oauth2/token',
      href: 'https://winkapi.quirky.com/oauth2/token',
      agent: false,
      method: 'POST',
      headers: { 'Content-Type': 'application/json' } }

so, i suspect that we're sending the same thing. odd.

@jso
Owner
jso commented
@mrose17

thanks. i'll try a few more things and then email them tomorrow...

@mrose17 mrose17 closed this
@jso
Owner
jso commented
@mattbornski

@mrose17 Email me a Charles web proxy session or a cURL command illustrating exactly what you're doing and I'll have a look.

@mrose17

many thanks! back in 5m.

@mrose17

@jso and @mattbornski - the repo is now public at https://github.com/TheThingSystem/node-winkapi

obviously, i'm doing something clueless here, but as to which clue i'm lacking, i'm not sure.

to test (on a system with node): edit test.'s to include "the needful" and then

    % node test.js
@mrose17

ps: feel free to push requests or issue me at https://github.com/TheThingSystem/node-winkapi/issues

@mrose17

@mattbornski i found the issue and updated the repo.

the issue is that the Wink API server doesn't like the JSON generated by JSON.stringify(). as @jso suggested, putting some whitespace in there made the parser happy! onward...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.