Hi,
I’m listening to the Amity webhook which informs my application of a new community post being created. Here are your docs:
https://api-docs.amity.co/#/WebhookEvent/get_webhook_v3_post_didCreate
Note that response.data.posts[0] object includes a “mentionees” array. This is great as I can see if anyone was mentioned in the post.
In my use case I now send an email to anyone mentioned in the post.
Now imagine the case where the original user who created the post makes an edit to the post and changes the mentionees (for example, they want to mention a second person). They edit the post, mention a second person and save the post.
Now, I’m also listening to the webhook for notification of a post update: Amity API
Note that the data structure for mentionees is the same, so I now get an array of two mentionees. Here’s the problem…
I don’t want to send another email to the original mentionee (that’s spammy). I only want to send an email to the second mentionee. To do this, either I need a before and after change snapshot of the data so that I can compare the two mentionee arrays and run some simple logic to decide if an email is needed.
Most services send before and after change data in an “update” type event. Can you suggest something I am missing or perhaps update your API to handle use cases like mine?
Thanks