sendinblue / APIv3-nodejs-library

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

createContact is returning null result #113

Closed GerjoGreenwaldMM closed 2 years ago

GerjoGreenwaldMM commented 2 years ago

Doing something like the below returns me an empty object. Upgraded to the latest version but no succes. Some subscriptions already exist, some not, but calls return data as null.

let CreateContact = {
      email: item.Email_address,
      listIds: [5],
      emailBlacklisted: false,
      smsBlacklisted: false,
      updateEnabled: true
  };
ContactsApi.createContact(CreateContact).then(function(data) {
    console.log('API called successfully. Returned data: ' + JSON.stringify(data));
}, function(error) {
    console.error(error);
});
shubhamUpadhyayInBlue commented 2 years ago

Hi @trueninjaturtle

The possibility is that the email that you are passing already exists and since you are passing updateEnabled: true it will return 204 status code without anything in the response body.

I am assuming this scenario. Rest if you can provide me with some more details like the exact payload I will try to replicate the issue and help you better. Thanks!

shubhamUpadhyayInBlue commented 2 years ago

Closing this issue since there is no reply for a long time. If you are still facing any issues you can open another one. Thanks!