2

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.

  • Please did you find a solution? I'm befuddled as to why there's like zero information about this error anywhere. Kindly assist please if you were able to resolve it – user627341 Mar 16 '22 at 14:50

0 Answers0