I am trying to make an API request to Wit.ai via javascript (ReactJS). My browser network tab shows the call fails with the message:
"error" : "Bad auth, check token/params"
However, that same call shows as successful in the Wit.ai logs. I've verified the credentials are correct and I can successfully cUrl the call via terminal.
Here's the call:
async action() {
const resp = await fetch('https://api.wit.ai/message?v=20160526&q=hello', {
method: 'GET',
headers: {
'Authorization': "Bearer " + accessToken
},
dataType: 'jsonp',
mode: 'no-cors',
credentials: 'include'
}).then(resp => resp.json()).catch(e => console.log('Boo', e));
}