I am trying to create a lookerbot. I want my node app to reach looker but I keep getting this error:
node:internal/process/promises:279
triggerUncaughtException(err, true /* fromPromise */);
^
[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "AxiosError: Request failed with status code 401".] {
code: 'ERR_UNHANDLED_REJECTION'
}
Node.js v17.9.0
error Command failed with exit code 1.
This is my code:
const axios = require('axios');
const qs = require('qs');
const SLACK_KEY = 'xoxb-1234';
const LOOKER_URL = 'https://xyz.abc.looker.com:19999/api/3.0/';
const LOOKER_CLIENT_ID = 'mnbv';
const LOOKER_CLIENT_SECRET = 'lkjh'
axios.get(LOOKER_URL, {
params: {
'clientId': LOOKER_CLIENT_ID,
'clientSecret': LOOKER_CLIENT_SECRET
}
})
.then(function (res) {
console.log(res);
})
I am not sure what my error is and how to make my node app reach my looker instance.