I am trying to get an access token after getting the authorization code. I have the following fetch request:
NOTE: the data supplied to the body contains all the required fields and their values, and the url variable is https://api.coinbase.com/oauth/token
fetch(`${url}`, {
method: "POST",
headers: {
"content-type": "application/json",
},
body: data,
})
.then((res) => {
console.log(res.json());
})
.catch((err) => {
console.error(err);
});
A resolved promise is logged, with a result of:
{errors: [{id: "service_unavailable", message: "It looks like we have encountered a problem. Sorry about that!"}]}
It also responds with a 400 status, but this error information does not help me understand why it is a bad request.
What is going on? I cannot find any information that covers this topic.