ResponseError: Forbidden

1.1k Views Asked by At

When I am trying to run node src/emails/account.js, this issues is showing me in my terminal, besides this i had also verified single sender request:

   ResponseError: Forbidden
    at Request._callback (node_modules/@sendgrid/client/src/classes/cl​‌​
ient.js:124:25)
    at Request.self.callback (node_modules/request/request.js:185:22)
    at Request.emit (events.js:321:20)
    at Request.<anonymous> (node_modules/request/request.js:1154:10)
    at Request.emit (events.js:321:20)
    at IncomingMessage.<anonymous> (node_modules/request/request.js:10​‌​
76:12)
    at Object.onceWrapper (events.js:427:28)
    at IncomingMessage.emit (events.js:333:22)
    at endReadableNT (_stream_readable.js:1201:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:2​‌​
1) {
  code: 403,
  message: 'Forbidden',
  response: {
    headers: {
      server: 'nginx',
      date: 'Sun, 12 Jul 2020 12:35:21 GMT',
      'content-type': 'application/json',
      'content-length': '281',
      connection: 'close',
      'access-control-allow-origin': 'https://sendgrid.api-docs.io',
      'access-control-allow-methods': 'POST',
      'access-control-allow-headers': 'Authorization, Content-Type, On​‌​
-behalf-of, x-sg-elas-acl',
      'access-control-max-age': '600',
      'x-no-cors-reason': 'https://sendgrid.com/docs/Classroom/Basics/​‌​
API/cors.html'
    },
    body: { errors: [Array] }
  }
}
1

There are 1 best solutions below

0
On

I had this same error and I found out that my verified email address in my node js app was wrong. Error 403 essentially means forbidden, which means that you don't have verified access. Try checking your verified email or API key. This will most likely solve any issues