christian
christian
NNovu
Created by christian on 11/14/2024 in #💬│support
Problem with PATCH subscriber
I'm tring to turn off the in-app notifications for a subscriber using the api But as you can see from the result I'm getting back it does not stick. The in_app notification channel is still enabled. What am i missing?
curl -X PATCH \
'https://api.novu.co/v1/subscribers/56f137d2-a642-4964-bd56-7f2119c359e6/preferences/672b8e95453679ea5584c82e' \
-H 'Content-Type: application/json' \
-H 'Authorization: ApiKey <redacted>' \
-d '{
"channel": {
"type": "in_app",
"enabled": false
}
}'

{"data":{"template":{"_id":"672b8e95453679ea5584c82e","name":"recipe_comment_new_in_app","tags":[],"critical":false,"triggers":[{"type":"event","identifier":"recipe_comment_new_in_app","variables":[],"reservedVariables":[],"subscriberVariables":[],"_id":"672b8e95453679ea5584c82f","id":"672b8e95453679ea5584c82f"}],"data":{"schema":{"type":"object","properties":{"commenterName":{"type":"string"},"image":{"type":"string"},"recipeTitle":{"type":"string"},"url":{"type":"string"}},"required":["commenterName","recipeTitle","url"],"additionalProperties":false},"unknownSchema":{"type":"object","properties":{"commenterName":{"type":"string"},"image":{"type":"string"},"recipeTitle":{"type":"string"},"url":{"type":"string"}},"required":["commenterName","recipeTitle","url"],"additionalProperties":false}}},"preference":{"enabled":true,"channels":{"in_app":true},"overrides":[{"channel":"in_app","source":"subscriber"}]},"type":"WORKFLOW_RESOURCE"}}⏎
curl -X PATCH \
'https://api.novu.co/v1/subscribers/56f137d2-a642-4964-bd56-7f2119c359e6/preferences/672b8e95453679ea5584c82e' \
-H 'Content-Type: application/json' \
-H 'Authorization: ApiKey <redacted>' \
-d '{
"channel": {
"type": "in_app",
"enabled": false
}
}'

{"data":{"template":{"_id":"672b8e95453679ea5584c82e","name":"recipe_comment_new_in_app","tags":[],"critical":false,"triggers":[{"type":"event","identifier":"recipe_comment_new_in_app","variables":[],"reservedVariables":[],"subscriberVariables":[],"_id":"672b8e95453679ea5584c82f","id":"672b8e95453679ea5584c82f"}],"data":{"schema":{"type":"object","properties":{"commenterName":{"type":"string"},"image":{"type":"string"},"recipeTitle":{"type":"string"},"url":{"type":"string"}},"required":["commenterName","recipeTitle","url"],"additionalProperties":false},"unknownSchema":{"type":"object","properties":{"commenterName":{"type":"string"},"image":{"type":"string"},"recipeTitle":{"type":"string"},"url":{"type":"string"}},"required":["commenterName","recipeTitle","url"],"additionalProperties":false}}},"preference":{"enabled":true,"channels":{"in_app":true},"overrides":[{"channel":"in_app","source":"subscriber"}]},"type":"WORKFLOW_RESOURCE"}}⏎
4 replies
NNovu
Created by christian on 11/6/2024 in #💬│support
How to handle the Bridge
Hello, I am a noob who's looking into this product, I am using a monorepo for my nextjs project and now I'm wondering if I am supposed to add the api endpoint in my main application or should I host it in another app just for novu stuff? What's your recommendation. Hope this question makes sense 🙂 Thank you
3 replies