I have a webhook handling post events, but if I delete a post, there is nothing that indicates deletion. I expected one of these fields to tell me it was deleted:
post {
u'deleted_at': None,
u'hidden': False,
u'user_deleted': False,
...
}
「いいね!」 1
justin
(Justin DiRose)
2019 年 6 月 28 日午後 6:55
4
はい、可能です。
私のサイトにあるロックされたカテゴリで投稿を 1 つ削除しました。Webhook が生成されましたが、ペイロードには投稿が削除された旨は示されておらず、ヘッダーにのみ記載されています。
ヘッダー:
Request URL: xxxxxxx
Request method: POST
Accept: */*
Connection: close
Content-Length: 880
Content-Type: application/json
Host: hooks.zapier.com
User-Agent: Discourse/2.4.0.beta1
X-Discourse-Instance: xxxxxxx
X-Discourse-Event-Id: 6334
X-Discourse-Event-Type: post
X-Discourse-Event: post_destroyed
ペイロード:
{
"post": {
"id": 11702,
"name": "Justin DiRose",
"username": "justindirose",
"avatar_template": "/user_avatar/xxxxxxxx/justindirose/{size}/1795_2.png",
"created_at": "2019-06-28T18:50:55.078Z",
"cooked": "<p>A new post here. Just for tests.</p>",
"post_number": 2,
"post_type": 1,
"updated_at": "2019-06-28T18:50:55.078Z",
"reply_count": 0,
"reply_to_post_number": null,
"quote_count": 0,
"incoming_link_count": 0,
"reads": 1,
"score": 0,
"topic_id": 5184,
"topic_slug": "test-webhook-topic",
"topic_title": "Test Webhook Topic",
"display_username": "Justin DiRose",
"primary_group_name": "",
"version": 1,
"user_title": "",
"moderator": true,
"admin": true,
"staff": true,
"user_id": xxx,
"hidden": false,
"trust_level": 4,
"deleted_at": null,
"user_deleted": false,
"edit_reason": null,
"wiki": false,
"reviewable_id": null,
"reviewable_score_count": 0,
"reviewable_score_pending_count": 0,
"topic_posts_count": 2
}
}
「いいね!」 6
Falco
(Falco)
2019 年 6 月 28 日午後 9:18
5
それは設計通りに動作していると思います。ウェッブフックは、アクションが破壊的である可能性があるため、オブジェクトの状態が変更される直前 のスナップショットを送信し、ウェッブフックの理由をヘッダーに含めます。
「いいね!」 5