0

I am using superagent to hit the docusign API with code received on the response of concent

const respo = await superagent
    .post('https://account-d.docusign.com/oauth/token')
    .set('Authorization', `${auth}`)
    .send({
        grant_type: 'authorization_code', 
        code: '.........'
    })

err : { Error: getaddrinfo EAI_AGAIN account-d.docusign.com account-d.docusign.com:443 at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26) errno: 'EAI_AGAIN', code: 'EAI_AGAIN', syscall: 'getaddrinfo', hostname: 'account-d.docusign.com', host: 'account-d.docusign.com', port: 443, response: undefined }

Afsanefda
  • 3,069
  • 6
  • 36
  • 76

2 Answers2

0

Based on Error: getaddrinfo EAI_AGAIN "EAI_AGAIN is a DNS lookup timed out error, means it is a network connectivity error or proxy related error."

You may want to check if you have a proxy/firewall or other issues on the box making the API calls. This is a networking issue you need to fix that has nothing to do with DocuSign directly.

Inbar Gazit
  • 12,566
  • 1
  • 16
  • 23
0

Thank you for the suggestion. But it was because I was not sending proper authentication. I did use curl though for this :

    curl
        .setHeaders([
            `Authorization: Basic ${auth}`,
            "Content-Type: application/x-www-form-urlencoded"
        ])
        .setBody({
            grant_type: "authorization_code",
            code: code
        })
        .post("https://account-d.docusign.com/oauth/token")
        .then(({ statusCode, body, headers }) => {})
        .catch(e => {});