Skip to content

Sending POST Request to Get Token Returns Error #6

Description

@chialuka

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions