400 error when submitting API refresh token request

400 error when submitting API refresh token request

I'm trying to set up the OAuth and generate the refresh token, but every time I send in the post request I get a 400 error and the message " An error occurred while processing your request.Please try again later.

I'm certain that all of the access information is correct so I don't know why I'm getting this error. I'm using axios to send the request and my code is 

  1. const axios = require('axios').default;

  2. var FormData= require('form-data');
  3. var fd= new FormData;
  4. fd.append('grant_type', 'authorization_code');
  5. fd.append('client_id', '1000.xxxxxxxxxxxxxx');
  6. fd.append('client_secret', 'xxxxxxxxxxxxxxxxx');
  7. fd.append('redirect_uri', 'https://api-console.zoho.com/client/xxxxxxxxxxxx');
  8. fd.append('code','1000.xxxxxxxxxxxxx');

  9. axios({
  10. method:'post',
  11. url:'https://accounts.zoho.com/oauth/v2/token',
  12. data: fd
  13. })

  14. .then(response =>{
  15. console.log(response)})
  16. .catch(error => {console.log(error.response)
  17. });