N
Novu11mo ago
prabhu pp

I have created topic added subscribers, but if i trigger event, getting error

Error : ========== ERROR (41): Unexpected error has occurred when triggering event worker | serviceName: "@novu/worker" worker | serviceVersion: "0.23.0" worker | platform: "Docker" worker | tenant: "OS" worker | transactionId: "c787a708-0f88-4027-9672-a103970ca15f" worker | environmentId: "65c1c8f84a82012402fb5528" worker | organizationId: "65c1c8f84a82012402fb5521" worker | context: "TriggerEventUseCase" worker | organization: "65c1c8f84a82012402fb5521" worker | triggerIdentifier: "testing-push-notification" worker | userId: "65c1c8bd4a82012402fb5518" worker | error: { worker | "response": { worker | "message": "subscriberId under property to is not configured, please make sure all subscribers contains subscriberId property", worker | "error": "Bad Request", worker | "statusCode": 400 worker | }, worker | "status": 400, worker | "options": {}, worker | "message": "subscriberId under property to is not configured, please make sure all subscribers contains subscriberId property", worker | "name": "ApiException" worker | } Topic created - {"data":{"_id":"65cc94a74a82012402fbb18d","key":"topic_for_payment"}} Success message after adding subscribers to topic - {"data":{"succeeded":["3945395","111","222","333"]}}%
Trigger payload :
$postData = '{ "name": "testing-push-notification", "to": [{ "type": "topic", "topicKey": "topic_for_payment" }], "payload": { } }';
13 Replies
Gali Baum
Gali Baum11mo ago
can you please try "type": "Topic" instead of topic ?
prabhu pp
prabhu ppOP11mo ago
@Gali Baum it is not working
Novu_Bot
Novu_Bot11mo ago
@prabhu pp, you just advanced to level 1!
Gali Baum
Gali Baum11mo ago
what if you trigger only to one subscriber? is that working?
prabhu pp
prabhu ppOP11mo ago
yes, if i mention subscriber id and triggered it is working , but without that it is not working
Pawan Jain
Pawan Jain11mo ago
@prabhu pp I tried to reproduce this on our cloud web.novu.co But it is working as expected could you please check on our cloud?
prabhu pp
prabhu ppOP11mo ago
@Pawan Jain thank you , will check and get back to ypou @Pawan Jain but in my environment if i tried with subscriber id it getting triggered, can i able to add multiple subscriber id in same case $postData = '{ "name": "testing-push-notification", "to": [{ "subscriberId":"3945395", "type": "topic", "topicKey": "topic_for_testing" }], "payload": {} }'; @Pawan Jain i have tested in web it is working, in my local hosting not working
Novu_Bot
Novu_Bot11mo ago
@prabhu pp, you just advanced to level 2!
Gali Baum
Gali Baum11mo ago
The syntax would be different objects for each topic and each subscriber
to: [
{ subscriberId: "3945395" },
{ type: "Topic", topicKey; "topic_for_testing"}
]
to: [
{ subscriberId: "3945395" },
{ type: "Topic", topicKey; "topic_for_testing"}
]
prabhu pp
prabhu ppOP11mo ago
@Gali Baum but while triggering topic , did we needs to send subscriberId filed in to section ? If i trigger with novu web api working , now i am trying with self hosted it is not working rather giving error like this "ERROR (16): Unexpected error has occurred when triggering event worker | serviceName: "@novu/worker" worker | serviceVersion: "0.23.0" worker | platform: "Docker" worker | tenant: "OS" worker | transactionId: "cab9d54f-f658-4eb2-b0e9-c2bd9b608c7d" worker | environmentId: "65c5d08f2ac34fee23ccb810" worker | organizationId: "65c5d08f2ac34fee23ccb809" worker | context: "TriggerEventUseCase" worker | organization: "65c5d08f2ac34fee23ccb809" worker | triggerIdentifier: "testing" worker | userId: "65c5d05d2ac34fee23ccb802" worker | error: { worker | "response": { worker | "message": "subscriberId under property to is not configured, please make sure all subscribers contains subscriberId property", worker | "error": "Bad Request", worker | "statusCode": 400 worker | }, worker | "status": 400, worker | "options": {}, worker | "message": "subscriberId under property to is not configured, please make sure all subscribers contains subscriberId property", worker | "name": "ApiException" worker | } " @Pawan Jain this is the compose file i have got and implemeted , any version mismatch here "" @Pawan Jain this is the composer yml file i have used
prabhu pp
prabhu ppOP11mo ago
GitHub
novu/docker/local/deployment at next · novuhq/novu
🔥 The open-source notification infrastructure with fully functional embedded notification center 🚀🚀🚀 - novuhq/novu
Pawan Jain
Pawan Jain11mo ago
@prabhu pp Are you using any sdk to trigger event?
prabhu pp
prabhu ppOP11mo ago
@Pawan Jain no , i am using php curl call with this object " $postData = '{ "name": "testing-push-notification", "to": { "type": "topic", "topicKey": "test_topic" }, "payload": { } }';"
Want results from more Discord servers?
Add your server