Trigger a topic
Hey all!
Today I updated the .NET SDK to the newest version and I try to send a notification to a topic.
The
novu.Event.TriggerTopicAsync
method which is mentioned in https://docs.novu.co/quickstarts/.NET#sending-a-notification-to-a-topic is not available in the newest SDK version 0.3.3
When I just want to know which API I need to call, I checked out the API reference at https://docs.novu.co/api-reference but there is no API for sending a notification to a topic.
Can someone tell me the API for sending a notification to a topic?11 Replies
@Sebastian Küsters could you please try something like this?
@Gali Baum thanks for the response - via the .NET SDK I can not extend the object dynamically like in node.js
For that reason I think the best is that I get information about the API, so that I can do the call without using the SDK. Can you help me there?
@Sebastian Küsters, you just advanced to level 2!
It is using same trigger endpoint https://docs.novu.co/api-reference. For a topic you ,the to attribute in the request is:
Novu
Start Point - Novu
Novu is an open-source notification infrastructure, built for engineering teams to help them build rich product notification experiences.
@Sebastian Küsters let me know if it works for you 🙂
Will try it out later - right now I am seeding the local setup.
There I am facing some timeout issues agains Novu API when calling GET topics - need to check this first out.
But I will update you as soon as I tried it.
@Gali Baum today I found time to seed our new account in the EU region.
I tried to trigger the topic as you descibed, but no success :/
Via .NET SDK the response is:
This is the .NET snippet:
Now I tried it via curl and get a successful reponse, but nothing happens and the Acitivy doesn't appear in the portal:
Response:
@sebastiankuesters
Did you create this topic with key
files-uploaded_8979296d-0c0c-4d83-bd0e-d58e66fc8cc2
before triggering the workflow using cURL
I could not find this topic files-uploaded_8979296d-0c0c-4d83-bd0e-d58e66fc8cc2
I see in logs
Topic with key files-uploaded_8979296d-0c0c-4d83-bd0e-d58e66fc8cc2 not found in current environment
@Pawan Jain thanks for the hint - I will double check it...
@Pawan Jain thanks for sharing the information - now it works. Maybe improve the error message here - because
workflow_not_found
is misleading.
Moreover I have to tell you that I wrote this so fast without investigation, because you describe nowhere in your docs how to actually trigger a topic. Only thanks to the hint by @Gali Baum here https://discordapp.com/channels/895029566685462578/1166659906460463165/1166673489869164564 I got a hint.
It's just feedback to improve the docs - beside that thanks you both for the great support here 🙏Hi @Sebastian Küsters
Thanks for sharing it worked.
We will update the docs
Do we have a ticket for that?