I'm trying to make a post request to an endpoint of the instagram api (https://api.instagram.com/oauth/access_token).
Here is what I'm doing:
const requestOptions = {
method: 'POST',
body: JSON.stringify({
client_id: APP_ID,
client_secret: APP_SECRET,
code,
grant_type: "authorization_code",
redirect_uri: REDIRECT_URI
})
};
fetch("https://api.instagram.com/oauth/access_token", requestOptions)
.then(r => r.json())
.then(r => console.log(r))
APP_ID, APP_SECRET & REDIRECT_URI aren't null (I can see them in the request payload)
However I still get a 400 error saying: "Missing required field client_id"
Any thoughts on this? Thanks