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