ETIMEDOUT in node.js when make a POST

ETIMEDOUT in node.js when make a POST

Hello everyone!
I have a problem when i make a POST request to accounts.zoho.com/oauth/v2/token for refresh access token in Javascript whit the API. I'm trying whit axios and request but nothing works, only keeps loading and after a few seconds the response is a ETIMEDOUT error.

Also i'm trying to create a ticket whit the API but the problem it's the same.

When i make any GET or POST on Postman (whit the same data that i use on javascript) it works whitout problems, retrieves the new token and i can create tickets. Even i'm using the code generated by Postman but not works.

Anyone else have this problem? I don't known what i'm doing wrong on javascript but on postman it's fine.

CODE IN JAVASCRIP FOR REFRESH ACCESS TOKEN

  1. const FormData = require('form-data');
  2. const axios = require('axios')
  3. var data = new FormData();
  4. data.append('refresh_token', '1000.token');
  5. data.append('client_id', '1000.id');
  6. data.append('client_secret', 'secret');
  7. data.append('scope', 'Desk.tickets.CREATE');
  8. data.append('redirect_uri', 'https://www.zylker.com/oauthgrant');
  9. data.append('grant_type', 'refresh_token');

  10. var config = {
  11.       method: 'post',
  12.       url: 'https://accounts.zoho.com/oauth/v2/token'
  13.       data: data
  14. };
  15. const data_response = await axios (config).then(function (response) {
                    console.log(JSON.stringify(response.data));
                    return JSON.stringify(response.data)
                })
                .catch(function (error) {
                    console.log(error);
                    return error
                });
            



      • Sticky Posts

      • Deprecation of SMS-based multi-factor authentication (MFA) mode

        Overview of SMS-based OTP MFA mode The SMS-based OTP MFA method involves the delivery of a one-time password to a user's mobile phone via SMS. The user receives the OTP on their mobile phone and enters it to sign into their account. SMS-based OTPs offer