Getting data: { error: 'invalid_request', error_description: 'Missing grant type' } }
Content-Type is correct, not sure what is wrong
return axiosInstance({
method: 'post',
url: axiosInstance.defaults.baseURL + '/oauth/token',
data: {
"grant_type": "vapi_key",
key: api_key
},
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
})
Edit: This is called via NodeJS
This is an open issue about this matter. Try this solution, Which suggest stringifing the data (you can use qs package for it) :
import qs from 'qs';
return axiosInstance({
method: 'post',
url: axiosInstance.defaults.baseURL + '/oauth/token',
data: {
"grant_type": "vapi_key",
key: api_key
},
data: qs.stringify({
"grant_type": "vapi_key",
key: api_key
}),
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With