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

Error message is not clear

Open pashaseliverstov opened this issue 9 years ago • 12 comments

{"message":"Response error","response":{"statusCode":400,"body":{"errors":[{"message":"Bad Request","field":null,"help":null}]},"headers":{"server":"n ginx","date":"Wed, 26 Apr 2017 01:14:46 GMT","content-type":"application/json","content-length":"63","connection":"close","x-frame-options":"DENY","ac cess-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"}}}

pashaseliverstov avatar Apr 26 '17 01:04 pashaseliverstov

Hello @pashaseliverstov,

I agree, that error message is not clear at all. Could you please provide some additional details so I can get to the root of the problem and discover what the real error is?

  1. Do you mind providing the source code that generated that error?
  2. What is the value of requestBody before you make the API call?
  3. Was this how you retrieved the error?

Thanks!

With Best Regards,

Elmer

thinkingserious avatar Apr 26 '17 17:04 thinkingserious

I have this same issue. did you find a solution @pashaseliverstov @thinkingserious ?

temitope avatar Sep 10 '17 01:09 temitope

@temitope,

What version of the library are you using?

With Best Regards,

Elmer

thinkingserious avatar Sep 11 '17 21:09 thinkingserious

Thanks @thinkingserious i am using this endpoint /v3/mail/send so I am assuming it is v3. Oddly it MAY be working if I change the destination email to a different value I think. super weird. still investigating. thanks

Is it possible that the error could occur if the CC and TO emails are the same?

temitope avatar Sep 11 '17 21:09 temitope

Hi @temitope,

I am referring to the SDK version. Thanks!

And yes, we do not allow duplicate emails.

With Best Regards,

Elmer

thinkingserious avatar Sep 11 '17 21:09 thinkingserious

Thank you so much for the timely response. It was version 5.1.0 and yes that duplicate address is the issue. I wish there was a specific error message/code reflecting that duplication issue, or simply a reduction/removal of one of the addresses, but I'm glad to finally know. @thinkingserious

temitope avatar Sep 11 '17 21:09 temitope

Thanks @temitope!

I believe you will find the error handling to be superior in v6.X of this library.

With Best Regards,

Elmer

thinkingserious avatar Sep 12 '17 20:09 thinkingserious

@thinkingserious wow, things got so much better and simpler in 6.X i see. thank you guys!

temitope avatar Sep 12 '17 22:09 temitope

@temitope,

@adamreisnz deserves the lion's share of the thanks :)

thinkingserious avatar Sep 12 '17 22:09 thinkingserious

indeed! thank you @adamreisnz you made my email-sending life a lot easier as a dev.

temitope avatar Sep 12 '17 23:09 temitope

@temitope no problem! It made my own life easier as well, so it's a win-win ;)

adamreisnz avatar Sep 12 '17 23:09 adamreisnz

give subject and template id and content type .it is saying error in body

jpkumar123 avatar Oct 08 '21 03:10 jpkumar123