sendinblue / APIv3-nodejs-library

SendinBlue's API v3 Node.js Library
ISC License
101 stars 47 forks source link

Empty params throw an error, even though docs list them as optional #103

Closed kybishop closed 3 years ago

kybishop commented 3 years ago

We have a template that doesn't use any params. When attempting to send an email with no params, which the docs list as optional here, it fails with "status":400,"text":"{\"code\":\"missing_parameter\",\"message\":\"params is blank\"}.

Adding a bogus param fixes the issue, so either the docs should be updated, or params actually made optional.

shubhamUpadhyayInBlue commented 3 years ago

Hi @kybishop

The reason for this error is that you are passing an empty params object in the payload i.e. params: {} Here is an example in the attachment where I sent a template without using the params object in the request body.

Screenshot 2021-06-09 at 9 49 52 PM

Happy to help! Shubham