Node.js SDK 401 (Unauthorized) on remove subs from topic
From what i can see, I'm doing it correctly:
let response = await novu.topics.removeSubscribers(topicKey, {
subscribers: [ subscriberInfo.mail ]
});
I know the topicKey and subscriberInfo.mail are correct, but it gives the following error when i try:
status code 401 at createError (/home/site/wwwroot/node_modules/axios/lib/core/createError.js:16:15) at settle (/home/site/wwwroot/node_modules/axios/lib/core/settle.js:17:12) at IncomingMessage.handleStreamEnd (/home/site/wwwroot/node_modules/axios/lib/adapters/http.js:269:11) at IncomingMessage.emit (node:events:525:35) at endReadableNT (node:internal/streams/readable:1358:12) at processTicksAndRejections (node:internal/process/task_queues:83:21) { config: { url: '/topics/tag::articles::hpv/subscribers/removal', method: 'post', data: '{"subscribers":["[email protected]"]}
Addition works fine, and when I use postman on the API it works without a hitch.
7 Replies
Hi @Tim Anderson
Sorry for late response
looking into this issue
@Tim Anderson
While trying to reproduce the issue, I get this error when I use invalid api key
Could you please check your apiKey ?
thanks Pawan.
@Tim Anderson, you just advanced to level 1!
@Tim Anderson is this issue fixed for you?
Yep, Pawan. Thank you for following up.
You were right, there was an issue with the key.