1

当我尝试运行node src/emails/account.js时,这个问题在我的终端中显示,除此之外我还验证了单个发件人请求:

   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] }
  }
}
4

1 回答 1

2

我有同样的错误,我发现我在我的节点 js 应用程序中验证的电子邮件地址是错误的。错误 403 本质上意味着禁止,这意味着您没有经过验证的访问权限。尝试检查您已验证的电子邮件或 API 密钥。这很可能会解决任何问题

于 2021-08-06T08:18:46.620 回答