For those interested here is NodeJS code using axis to refresh token. Note that the required grant_type and refresh_token parameters are to be sent via body and not as query parameters in url.
function refreshAccessToken(token) {
let url = 'https://api.infusionsoft.com/token'
let authData = clientId + ':' + clientSecret
/* global Buffer */
let buff = Buffer.from(authData)
let headers = {
'Authorization': 'Basic ' + buff.toString('base64'),
'Content-Type': 'application/x-www-form-urlencoded'
}
const data = new URLSearchParams();
data.append('grant_type', 'refresh_token');
data.append('refresh_token', token);
post(url, data, {headers: headers})
.then((res) => {
console.log('got token', res.data)
})
.catch((err) => {
console.log('AXIOS Error: ', err)
})
}