I've been trying to send a POST request to get the token but I keep getting an error from the API saying the request is invalid. I'm using Node.js.
const token = await axios({
method: 'post',
url: 'https://icdaccessmanagement.who.int/connect/token',
data: {
client_id: ICD_CLIENT_ID,
client_secret: ICD_CLIENT_SECRET,
scope: 'icdapi_access',
grant_type: 'client_credentials',
},
});
return token;
The request returns a 400 status code with response: data: { error: 'invalid_request' }
I'm not sure where the problem is from and I'd appreciate any help.