Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API key not being used #2

Closed
rarkins opened this issue Feb 27, 2015 · 1 comment
Closed

API key not being used #2

rarkins opened this issue Feb 27, 2015 · 1 comment

Comments

@rarkins
Copy link

rarkins commented Feb 27, 2015

I tried running the very first example in the README and it failed.

index.js:

var etsyjs = require('etsy-js');
var client = etsyjs.client('IPUTMYAPIKEYHERE');

// direct API calls (GET / PUT / POST / DELETE)
client.get('/users/sparkleprincess', {}, function (err, status, body, headers) {
  console.log(body); //json object
});

Running it:

$ node index.js
'==> Client get request with params [object Object]'
'==> Perform unauthenticated GET request'
'API URL is https://openapi.etsy.com/v2/users/sparkleprincess '
'Error parsing response: API request missing api_key or valid OAuth parameters'
undefined
$

I verified that if I take the same URL and add ?api_key=....... to it in a browser, it works fine. So seems that client is not including the api_key header?

@rarkins
Copy link
Author

rarkins commented Feb 27, 2015

Never mind, seems it's a documentation error. It should read:

var client = etsyjs.client({
  key: 'key'
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant