Discussions

Ask a Question
Back to All

ServiceM8 Not reathenticating

I get a 400 error with trying to obtain the refresh token. I seem to be following the documentation but i can't refresh my clients.

Here is my code:

const response = await sm8.post('access_token', {
grant_type: 'refresh_token',
client_id: process.env.SM8_OAUTH_CLIENT_ID,
client_secret: process.env.SM8_OAUTH_CLIENT_SECRET,
refresh_token: refresh_token,
})

Refresh token is the token saved when OAuthing