Missing grant type when obtaining access token

in Development
I'm making a POST request to https://cloud.lightspeedapp.com/oauth/access_token.php, using javascript.
I've include all the body fields and content-type header, but I always get the following error:
`{ error: 'invalid_request', error_description: 'The grant type was not specified in the request' }`
Answers
The client_id and client_secret values appear to be missing in your screen shot. Was this intentional?
Yep, it was intentional.
Not sure if it's because you are perhaps in a different region that I am (I'm in the US), but I looked at my saved Postman calls, and my specifics are about the same. Only difference is the POST URL, which is https://cloud.merchantos.com/oauth/access_token.php.
Weird...
I've followed the documentation: https://developers.lightspeedhq.com/retail/authentication/access-token/#requesting-an-access-token
I finally got it to work:
Content-Type: 'application/json' and stringifying the body
Although I don't know if this is the right way.
Hey @christian_sanchez, this is the correct way!
I believe there is also a way to send form data but it I tend to send it via an object.
Question, I see you're using the fetch method to make your API requests. Are you using node-fetch on a Node.js back-end or will this code live on the client somewhere?
Adrian Samuel
Software Developer
Lightspeed HQ