Back

Webhook database trigger only when NOT from Server SDK (API key)

  • 1
  • Self Hosted
  • Webhooks
  • Databases
Kuromory
5 Apr, 2024, 13:03

Like in the title I need to Sync the Appwrite with a other SQL Database so I got a Webhook trigger when something has a create/update/delete event in appwrite, now because other applications still need to use the other database I also write with my c# backend the new values into the appwrite database... is it possible to just trigger the event when it is NOT the c# backend?

TL;DR
Solution: To prevent the webhook trigger when the update is from the C# backend, you can add a conditional check within the webhook implementation to verify the source of the request. Create a validation step that only triggers the event if the request is not initiated by the C# backend, using different authentication methods or headers to differentiate between the sources. This way, the webhook will only execute for updates that are not from the C# backend.
WhiteWalker72
5 Apr, 2024, 13:12

Indeed would be nice to have the option to not trigger an event. I once wrote a function that would trigger after a document update and it would update the document again so that didn't end well.. πŸ˜“

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more