Distinguish private messages from posts?

Here’s the code that I’m using to trace out the event objects: https://github.com/MyPureCloud/Discourse-Webhooks/blob/master/plugin.rb#L85

Here’s the result of that trace for a PM reply. I believe the topic is the second object in the params array. I’ve truncated the user object for brevity.

[
  {
    "id": 242,
    "user_id": 2,
    "topic_id": 177,
    "post_number": 3,
    "raw": "replying in a PM asdf1234",
    "cooked": "<p>replying in a PM asdf1234</p>",
    "created_at": "2016-10-12T21:03:33.334Z",
    "updated_at": "2016-10-12T21:03:33.334Z",
    "reply_to_post_number": null,
    "reply_count": 0,
    "quote_count": 0,
    "deleted_at": null,
    "off_topic_count": 0,
    "like_count": 0,
    "incoming_link_count": 0,
    "bookmark_count": 0,
    "avg_time": null,
    "score": null,
    "reads": 0,
    "post_type": 1,
    "vote_count": 0,
    "sort_order": 3,
    "last_editor_id": 2,
    "hidden": false,
    "hidden_reason_id": null,
    "notify_moderators_count": 0,
    "spam_count": 0,
    "illegal_count": 0,
    "inappropriate_count": 0,
    "last_version_at": "2016-10-12T21:03:33.350Z",
    "user_deleted": false,
    "reply_to_user_id": null,
    "percent_rank": 1,
    "notify_user_count": 0,
    "like_score": 0,
    "deleted_by_id": null,
    "edit_reason": null,
    "word_count": 5,
    "version": 1,
    "cook_method": 1,
    "wiki": false,
    "baked_at": "2016-10-12T21:03:33.334Z",
    "baked_version": 1,
    "hidden_at": null,
    "self_edits": 0,
    "reply_quoted": false,
    "via_email": false,
    "raw_email": null,
    "public_version": 1,
    "action_code": null
  },
  {
    "raw": "replying in a PM asdf1234",
    "topic_id": "177",
    "archetype": "regular",
    "category": "",
    "typing_duration_msecs": "1900",
    "composer_open_duration_msecs": "11839",
    "visible": true,
    "is_warning": false,
    "ip_address": "127.0.0.1",
    "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36",
    "referrer": "https://developer.inindca.com/forum/t/hey-this-is-a-pm/177",
    "first_post_checks": true
  },
  {
    "id": 2,
    "username": "tim.smith",
    "avatar_template": "/forum/user_avatar/developer.inindca.com/tim.smith/{size}/58_1.png",
    "name": "Tim Smith",
    "last_posted_at": "2016-10-12T21:03:33.334Z",
    "last_seen_at": "2016-10-12T21:03:14.864Z"
  }
]

edit: here’s a screenshot showing that the post is indeed a reply to a PM: