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
Pawan Jain
Pawan Jain15mo ago
Hi @Tim Anderson Sorry for late response looking into this issue
Pawan Jain
Pawan Jain15mo ago
@Tim Anderson While trying to reproduce the issue, I get this error when I use invalid api key
No description
Pawan Jain
Pawan Jain15mo ago
Could you please check your apiKey ?
Tim Anderson
Tim AndersonOP15mo ago
thanks Pawan.
Novu_Bot
Novu_Bot15mo ago
@Tim Anderson, you just advanced to level 1!
Pawan Jain
Pawan Jain14mo ago
@Tim Anderson is this issue fixed for you?
Tim Anderson
Tim AndersonOP14mo ago
Yep, Pawan. Thank you for following up. You were right, there was an issue with the key.

Did you find this page helpful?