Hello guys, I’m trying to consume some data from https://api.newrelic.com/, I already have the query structure but once I fetch I get ‘Request failed with status code 401’, I’m passing my Api key on the request, any ideas how to fix that?? thanks for your help
axios({
url: 'https://api.newrelic.com/graphiql',
method: 'get',
headers: {
"Api-Key": "MYAPIKEYHERE",
"Content-Type": "application/json",
"Access-Control-Allow-Origin": "http://localhost:3000/",
"Access-Control-Allow-Methods": "POST",
"charset": "UTF-8",
},
data: {
query: myQuery
}
}).then((result) => {
console.log(result.data)
}).catch((error) => {
console.log(error);
});