running a loop to push messages via the web messaging api. the access token expires halfway through and i get a 401 unauthorized error. how do i handle the refresh token in js so the job keeps going?
fetch(url, {
headers: { ‘Authorization’: 'Bearer ’ + token }
})