-
Notifications
You must be signed in to change notification settings - Fork 323
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
Numeric values cause 400 Bad Request with no explanation #142
Comments
Hi @brian4d, Agreed and thanks for taking the time to spell out the issue in detail! I have added this to our backlog for implementation. With Best Regards, Elmer |
Any word on fixing this? Ideally the API would just return a better error message, and/or accept any valid JSON in |
Hi @percyhanna, I've added your vote to this issue to help it rise in our backlog. It can continue to rise with additional +1s, comments or a PR. A PR would cause the greatest impact. Thanks! Elmer |
Hey @thinkingserious can I help with this? |
Thanks @sitaramshelke! It's all yours :) |
Thanks @sitaramshelke ! |
Issue Summary
Was stumped briefly while upgrading to Ver 3 of the API. I had followed the example code but was getting "400 Bad Request" without any other explanation.
mail.custom_args = CustomArg.new(:key => 'list_id', :value => self.list_id)
mail.custom_args = CustomArg.new(:key => 'message_id', :value => self.id)
personalization.substitutions = Substitution.new(:key => '-person_id-', :value => subscriber.id)
Finally figured it might be caused by a few numeric values in the CustomArgs and Substitutions. Voila!
mail.custom_args = CustomArg.new(:key => 'list_id', :value => self.list_id.to_s)
mail.custom_args = CustomArg.new(:key => 'message_id', :value => self.id.to_s)
personalization.substitutions = Substitution.new(:key => '-person_id-', :value => subscriber.id.to_s)
It would be great if the gem automatically converted these values to strings -- particularly since the error message is so generic. Thanks.
Technical details:
The text was updated successfully, but these errors were encountered: