N
Novu15mo ago
Pawan Jain

updatePreference method gives 400 error in node sdk version 0.14.0

1 Reply
Pawan Jain
Pawan JainOP15mo ago
Hey so coming back to this, I am using @novu/node version 0.14.0 I am formatting my request like so:
await novu.subscribers.updatePreference(String(organizationId), 'product-created', {
enabled: setActive,
})
await novu.subscribers.updatePreference(String(organizationId), 'product-created', {
enabled: setActive,
})
- using the debugger I have verified that setActive is = false in the boolean not a string - I have verified that product-created is infact the template-id from my novu web dashboard - the API key I am using is for sure correct as I have used it in the past to send through notifications. - I have also verified that this is a valid subscriber ID With that being said I am getting a pretty generic HTTP 400 axios error: 'Request failed with status code 400' @.goobypls Are you sure String(organizationId) is your subscriberId? why you are changing enabled field? are you looking to disable, enable particular channel of workflow? https://docs.novu.co/subscribers/preferences#update-subscriber-preference-for-a-workflow
Want results from more Discord servers?
Add your server