im using axios to connect my bot to dialog-flow API v1.it is returning a 401 error saying unauthorized?
i have all ready set up the headers and the data types to application/json.
var axios =require('axios');
var URL ='https://api.dialogflow.com/v1/';
let config = {
headers: {
"Authorization": "Bearer " + '4c52dfb9db61xxxxxxxxxxxxx',
"Content-Type": "application/json"
}
}
var bodyParameters = {
"queryInput": { "text":
{ }
},
"query": "hi hello",
"languageCode": "en",
"sessionId": "12345",
"timezone": "xxxxx"
};
axios.get(URL,bodyParameters, config)
.then(function(res){
console.log(res.data);
}).catch(function(error){
console.log(error);
});
is there some error in authorization?