Hi All,
I’ve been scrutinizing the various JSON post results from our webhooks. We record and react to public posts that contribute to our common knowledge-base differently than PMs or discobot conversations. For example, it’s relatively easy to filter out posts from discobot using its userid; likewise with system posts and topics. However, I haven’t been able to identify a reliable way to filter posts back to discobot, or PMs between two users. At first I thought only PMs had a “reply_to_user” field, but it appears that some (but not all) posts have it also. Here is an example of what we are trying to filter out:
{
"post": {
"id": 1296,
"name": "Test User",
"username": "testuser",
"avatar_template": "/letter_avatar_proxy/v2/letter/c/stringhere/{size}.png",
"created_at": "2017-12-14T21:11:30.992Z",
"cooked": "\u003cp\u003e[quote=\"cutlery, post:11, topic:626\"]\u003cbr\u003eIf this is coffee, please bring me some tea; but if this is tea, please bring me some coffee\u003c/p\u003e",
"post_number": 13,
"post_type": 1,
"updated_at": "2017-12-14T21:11:30.992Z",
"reply_count": 0,
"reply_to_post_number": 11,
"quote_count": 1,
"avg_time": null,
"incoming_link_count": 0,
"reads": 1,
"score": 0,
"yours": false,
"topic_id": 626,
"topic_slug": "robot-greetings",
"topic_title": ":robot: Greetings!",
"display_username": "Test User",
"primary_group_name": null,
"primary_group_flair_url": null,
"primary_group_flair_bg_color": null,
"primary_group_flair_color": null,
"version": 1,
"user_title": null,
"reply_to_user": {
"username": "testuser",
"avatar_template": "/letter_avatar_proxy/v2/letter/c/stringhere/{size}.png"
},
"actions_summary": [{
"id": 2,
"can_act": true
}, {
"id": 3,
"can_act": true
}, {
"id": 4,
"can_act": true
}, {
"id": 5,
"hidden": true,
"can_act": true
}, {
"id": 6,
"can_act": true
}, {
"id": 7,
"can_act": true
}, {
"id": 8,
"can_act": true
}],
"moderator": false,
"admin": false,
"staff": false,
"user_id": 1234,
"hidden": false,
"hidden_reason_id": null,
"trust_level": 0,
"deleted_at": null,
"user_deleted": false,
"edit_reason": null,
"can_view_edit_history": true,
"wiki": false
}
}