هل حدث post_edit الخاص بـ Webhook لا يتم إطلاقه؟

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)

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)

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)

How did you set up the webhooks?

إعجاب واحد (1)

image

إعجابَين (2)

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 إعجابات

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 إعجابات

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

4 إعجابات

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)

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)

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

إعجاب واحد (1)

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