sendinblue / APIv3-nodejs-library

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

We should not url encode params #129

Closed hadrien-f closed 2 years ago

hadrien-f commented 2 years ago

Hello,

I noticed the documentation mentions we have to url encode params used in url path. For example to unblock a transactional contact : https://github.com/sendinblue/APIv3-nodejs-library/blob/master/docs/TransactionalEmailsApi.md?plain=1#L1194

However in apiClient.js you already url encode each params in the url : https://github.com/sendinblue/APIv3-nodejs-library/blob/ecf167b9b9da2802f9bae858ecc8fb723cc80d23/src/ApiClient.js#L143

So we should not do it as the documentation mentions.

shubhamUpadhyayInBlue commented 2 years ago

Hi @hadrien-f

You only have to encode the parameters which are being passed:

But, in this endpoint to send a transacitonal email you are passing all the values in the body of the request. There is no need to urlEncode it.

Happy to help! Shubham