I’m trying to refresh my oAuth token like that
const options = {
method: "POST",
headers: {
"Authorization": `Basic ${authorization}`,
"Content-Type": "application/x-www-form-urlencoded",
},
body: {
"grant_type": "refresh_token",
"refresh_token": UserPipeDrive?.refresh_token /* as string */,
},
};
const newToken = await fetch(
"https://oauth.pipedrive.com/oauth/token",
options
)
.then((response) => response.json())
.then((response) => {
return response;
})
.catch((err) => console.error(err));
But ! the PipeDrive API send me an error about the parameter grant_type, this is the error :
ERROR: {
success: false,
message: 'Missing parameter: `grant_type`',
error: 'invalid_request'
}
the parameter grant_type is send in the body like the doc showed.