Node http.post to get an access token is returning a 404 status


#1

BIG EDIT: IT WAS A TYPO. OATH!!!

I have a client_id, secret_key, code and my redirect_uri is the same as when I authorized. I’m using an npm “request” module in node but the response is 404.

I think the relevant issues has something to do with the payload:

var options = {
method: ‘POST’,
uri: ‘https://api.hubapi.com/oath/v1/token’,
body: data,
json: true
};

In the above, “data” is = “grant_type=authorization_code&client_id=xxx&client_secret=xxx&redirect_uri=https://original-url.com/&code=xxx”

Anything clearly wrong here?

Update: A more general question, am I trying to make a post to "https://api.hubapi.com/oath/v1/token?grant_type=authorization_code&client_id=etc… or am I trying to make a post to “https://api.hubabi.com/oath/v1/token” and the body of that request should be a string containing “grant_type=authorization_code…etc.” (or a JSON object containing {key: value} pairs with that info. This at least would give me some direction.