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

Error 406 on QuickStart sample code and undefines when trying getCredentials #237

Open
akbarganey opened this issue Jul 21, 2024 · 1 comment

Comments

@akbarganey
Copy link

I get an error 406 on using the QuickStart sample code and after changing the code to put the call inside an async function,

const connection = ....
(async () => {
/* get all devices */
const devices = await connection.getDevices();
console.log(devices);
})()

The error is : { error: 406, msg: 'Authentication failed' }

If I try to use the sample code from getCredentials,

const auth = await connection.getCredentials();

console.log('access token: ', auth.at);
console.log('api key: ', auth.user.apikey);
console.log('region: ', auth.region);

I get an the following:
access token: undefined
api key: undefined
region: undefined

My code worked previously, but I have not run it recently. I am on version 3.1.1. of ewelink-api

@akbarganey
Copy link
Author

On the seond example (getCredentials), when trying to print 'auth', I get error 403:
{ error: 403, msg: 'Sign:oauthClient enable invalid' }

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