sendgrid-nodejs icon indicating copy to clipboard operation
sendgrid-nodejs copied to clipboard

Sending multiple mail to multiple recipient

Open ppratik2410 opened this issue 7 years ago • 4 comments

{ Error: Unauthorized at Request.http [as _callback] (D:\25-09-2018\9-2\India\india-api\node_modules@sendgrid\client\src\classes\client.js:124:25) at Request.self.callback (D:\25-09-2018\9-2\India\india-api\node_modules\request\request.js:185:22) at Request.emit (events.js:188:13) at Request.EventEmitter.emit (domain.js:439:20) at Request. (D:\25-09-2018\9-2\India\india-api\node_modules\request\request.js:1161:10) at Request.emit (events.js:188:13) at Request.EventEmitter.emit (domain.js:439:20) at IncomingMessage. (D:\25-09-2018\9-2\India\india-api\node_modules\request\request.js:1083:12) at Object.onceWrapper (events.js:276:13) at IncomingMessage.emit (events.js:193:15) at IncomingMessage.EventEmitter.emit (domain.js:439:20) at endReadableNT (_stream_readable.js:1129:12) at processTicksAndRejections (internal/process/next_tick.js:76:17) code: 401, message: 'Unauthorized', response: { headers: { server: 'nginx', date: 'Fri, 12 Apr 2019 06:57:47 GMT', 'content-type': 'application/json', 'content-length': '76', 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: undefined } } Unauthorized (401)

ppratik2410 avatar Apr 12 '19 06:04 ppratik2410

Hello @ppratik2410,

That error means there is an issue with your API Key. Either your key does not have permissions for that API call, or the API Key did not get set properly.

With Best Regards,

Elmer

thinkingserious avatar Apr 12 '19 13:04 thinkingserious

I am sending emails in chunks array of 100-100. But first 100 Email is getting send but after other give me unauthorised (401) error

ppratik2410 avatar Apr 13 '19 05:04 ppratik2410

Hello @ppratik2410,

I suggest you reach out to our support team to check if there are any limitations on your account.

thinkingserious avatar Apr 16 '19 15:04 thinkingserious

Same problem for me! @ppratik2410 did you resolve?

francesco-clementi avatar Sep 09 '19 08:09 francesco-clementi