Webhook for whisper posts

Is there a webhook that could fire when someone creates a Whisper post? I’m guessing not but just in case I’m asking.

I don’t think it’s possible to configure a webhooks so that it only fires when a whisper post is created, but you can create a Post Events webhook and then filter for whisper posts in the code that receives the webhook.

The payload for whisper posts will have the post_type field set to 4. For example:

{
  "post": {
    "id": 740,
    "name": null,
    "username": "scossar",
    "avatar_template": "/letter_avatar_proxy/v4/letter/s/b77776/{size}.png",
    "created_at": "2024-10-18T17:00:36.065Z",
    "cooked": "<p>testing whispers and webhooks</p>",
    "post_number": 5,
    "post_type": 4,
    ...

The possible values for the post_type field are:

[2] pry(main)> Post.types
=> {:regular=>1,
 :moderator_action=>2,
 :small_action=>3,
 :whisper=>4}
4 Likes

Many thanks @simon

That is simpler than I thought. I didn’t realize/see that 4 is the code for whisper.

Rene

1 Like

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