Webhook post_edit event is not being fired?

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!

2 Likes

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. :wink:

1 Like

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.

2 Likes

How did you set up the webhooks?

1 Like

image

2 Likes

This is outside my technical skills, was asking to get more info so the more technical folks can better help :slight_smile: please hang tight

3 Likes

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?

3 Likes

If you consider that posts doesn’t have “title/category/tags” it makes sense. Only topics have “title/category/tags”.

4 Likes

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.

2 Likes

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?

1 Like

Ah nevermind, I didn’t fetch the object fields correctly.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.