-
Notifications
You must be signed in to change notification settings - Fork 703
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SendGrid v3 with HTML - 400 Bad Request #187
Comments
I'm having the same error pop up for me while trying to use a template. Should I make another issue? Here's my code snippet:
|
Could you please provide the code that you are having trouble with? Or at least the return value from When you use the Mail constructor, we build the personalization object for you, so to add to it, you would do this: https://github.com/sendgrid/sendgrid-python/blob/master/examples/helpers/mail/mail_example.py#L16 What you are doing is creating a new personalization object. If you print out the value of Thanks! |
@thinkingserious Thanks. I had to add a Here's the code snippet for those that stumble upon this:
|
The following codes gives me: HTTP Error 400: Bad Request
|
Hi @Davey-Dev, For the exception, can you tell me what Also, can you do Thanks! |
Looks like v2 wasn't truncating or throwing exceptions. I have a message that was sent with an 84 character count subject. |
Hello @Davey-Dev, Yes, that is a new behavior for v3. The Internet Message Format RFC recommends that subject lines be kept less than 78 characters, so to help provide better delivery while promoting best practices, that limit was imposed through the API. Thank you for following up! |
ergdfgfdg |
Hi @thinkingserious, I'm a new customer and I just want to express how disappointed I am the quality of the Sendgrid's Client SDKs, Server responses and in general – the poor decision making theme I see across your developer-facing technologies. I decided this evening to stop tip toeing around Python SDK bugs and write my own thin API client using the Here is an actual raw JSON response I just got from your API: {"errors":[{"message":"Bad Request","field":null,"help":null}]} What am I supposed to do with an error response like that? I'm sorry, but this is unacceptable. My only suggestion is to invest some time studying other popular REST APIs to see what makes them great. A good example is Stripe's Python Client SDK as well as the actual REST API responses for error states. Thanks, Michael |
I'm using sendgrid-python(sendgrid) 6.0.5 and still getting this response
Turns out the substitution values need to be a In my case, I have numbers as a substitution value. Fixed by just adding But, the error response is not helpful |
My apologies @iMerica, @RamKrish2079 and any others effected by these non-useful error messages. It looks like a PR was created to update our docs for this and I failed to include it in our last release. Please take a look and let me know if this helps: https://github.com/sendgrid/sendgrid-python/blob/master/TROUBLESHOOTING.md#error With Best Regards, Elmer |
This link is broken. Arrived via Google. Thanks. |
I believe this is the correct link: sendgrid-python/examples/mail/mail.py Line 95 in 5a31c75
Thank you for the heads up @davidbernat! If you are having issues, please open a new issue. Thank you! |
Issue Summary
I've been trying to migrate to v3 API and several of my emails to be sent get BadRequest responses that v2 does not give me (had to revert back). I believe that Json being created for the e-mail is bad as same as here:
sendgrid/sendgrid-csharp#256
Technical details:
The text was updated successfully, but these errors were encountered: