Hi everyone,
I’m having issue setting up the webhook for post. For some reason, the post_edited event is not being fired. I’m only getting post_created event.
any idea?
Thanks!
In a support thread titled ‘Webhook post_edit event is not being fired?’, j3ang reports that the post_edited webhook event isn’t triggering, despite receiving post_created. osioke asks for setup details and logs, but j3ang finds no helpful logs beyond the admin webhook tab. After testing, j3ang discovers that post_edited only fires when post content changes — not when title, category, or tags are edited, which apply to topics, not posts, as clarified by Falco. j3ang confirms events now fire correctly and realizes they need to handle both Topic and Post events for syncing to WordPress. Later, j3ang tries extending the web_hook_topic payload using add_to_serializer, but encounters a 500 error — resolved in post 12 by correcting object field access. The issue was rooted in misunderstanding the distinction between post and topic attributes, and serializer usage.
Hi everyone,
I’m having issue setting up the webhook for post. For some reason, the post_edited event is not being fired. I’m only getting post_created event.
any idea?
Thanks!
Any errors popping up? Can you share in detail how you set up the webhooks too? We’ll need some additional info or context to be able to help here. ![]()
Hi @osioke ,
I have no idea where to find logs for the webhooks except in the admin settings api/webhook tab. but it’s nothing but the post_created events.
I can’t find anything helpful in the production.log when create/edit a new post.
How did you set up the webhooks?
This is outside my technical skills, was asking to get more info so the more technical folks can better help
please hang tight
Hi @osioke,
I just found out that the post_edit event will only fire when the post content is edited.
If I just change the title/category/tags alone wouldn’t trigger the edit event.
Is this the default behavior?
If you consider that posts doesn’t have “title/category/tags” it makes sense. Only topics have “title/category/tags”.
Thanks. I see, just tested and the events are being fired.
I’m trying to syncing the questions post back to our WordPress, and embedding the discourse answers/replies. So I only care on the changes to the first post in the topic.
It seems like I will have to work with both Topic & Post event.
When I was using the post webhook, I could do
add_to_serializer(:web_hook_post, :category_import_id, false) in a plugin to add extra field in the payload.
I’m trying to do the samething for topic, I found that there’s only web_hook_topic_view, but add_to_serializer does not work and causes 500 error.
Do I have to create a custom serializer myself in the plugin?
Ah nevermind, I didn’t fetch the object fields correctly.