# Making a difference between public topic and private message on API

**URL:** <https://meta.discourse.org/t/making-a-difference-between-public-topic-and-private-message-on-api/108119>\
**Category:** Feature\
**Created:** [February 1, 2019, 11:54am UTC](https://meta.discourse.org/t/making-a-difference-between-public-topic-and-private-message-on-api/108119 "2019-02-01T11:54:05Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![TheChachara](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thechachara/32/130217_2.png) [@TheChachara](https://meta.discourse.org/u/TheChachara)\
**Post date:** [February 1, 2019, 11:54am UTC](https://meta.discourse.org/t/making-a-difference-between-public-topic-and-private-message-on-api/108119/1 "2019-02-01T11:54:05Z")

</div>

Hi y’all.  
I’ve created a very tiny bot for our discourse installation which fires upon a webhook.  
I’ve also connected the bot to Twitter, so every time anybody creates a new topic, a tweet is posted on our Twitter account (Thanks to Abraham for his [https://twitteroauth.com](https://twitteroauth.com))

The thing is that, because of how Discourse is created, everything is a post. Both public and private messages.  
In my particular case, here’s the post object from a _public post_:

```plaintext
stdClass Object
(
    [post] => stdClass Object
        (
            [id] => 909
            [username] => TheChachara
            [avatar_template] => /user_avatar/thechachara.com/thechachara/{size}/46_2.png
            [created_at] => 2019-02-01T11:50:23.974Z
            [cooked] => <p>Posted on a public category.</p>
            [post_number] => 1
            [post_type] => 1
            [updated_at] => 2019-02-01T11:50:23.974Z
            [reply_count] => 0
            [reply_to_post_number] => 
            [quote_count] => 0
            [avg_time] => 
            [incoming_link_count] => 0
            [reads] => 0
            [score] => 0
            [topic_id] => 63
            [topic_slug] => this-is-a-public-topic
            [topic_title] => This is a public topic
            [primary_group_name] => 
            [version] => 1
            [user_title] => 
            [moderator] => 
            [admin] => 1
            [staff] => 1
            [user_id] => 1
            [hidden] => 
            [trust_level] => 1
            [deleted_at] => 
            [user_deleted] => 
            [edit_reason] => 
            [wiki] => 
            [topic_posts_count] => 1
        )

)

```

On the other hand, this is a _private message_:

```plaintext
stdClass Object
(
    [post] => stdClass Object
        (
            [id] => 908
            [username] => TheChachara
            [avatar_template] => /user_avatar/thechachara.com/thechachara/{size}/46_2.png
            [created_at] => 2019-02-01T11:37:14.954Z
            [cooked] => <p>Esto es un mensaje de prueba</p>
            [post_number] => 1
            [post_type] => 1
            [updated_at] => 2019-02-01T11:37:14.954Z
            [reply_count] => 0
            [reply_to_post_number] => 
            [quote_count] => 0
            [avg_time] => 
            [incoming_link_count] => 0
            [reads] => 0
            [score] => 0
            [topic_id] => 62
            [topic_slug] => nuevo-mensaje-publicado
            [topic_title] => Nuevo mensaje publicado
            [primary_group_name] => 
            [version] => 1
            [user_title] => 
            [moderator] => 
            [admin] => 1
            [staff] => 1
            [user_id] => 1
            [hidden] => 
            [trust_level] => 1
            [deleted_at] => 
            [user_deleted] => 
            [edit_reason] => 
            [wiki] => 
            [topic_posts_count] => 1
        )

)

```

I can’t find a way to make a difference between them.

The solution I came to is to set which categories to report by the webhook, but I would like to control it from the bot, because tomorrow (yep, [Dory](https://www.muyinteresante.com.mx/wp-content/uploads/2018/05/httpstved-prod.adobecqms.netcontentdameditorialTelevisamexicomuyinteresantemxcuriosidadespreguntas-y-respuestas17074dorynemo.imgo_.jpeg)’s memory here) I could add a new category, and forget to allow this category to be checked when sending the webhook.

Is there a way to send more data over the webhook?

TiA people 🙂

---

_[View the full topic](https://meta.discourse.org/t/making-a-difference-between-public-topic-and-private-message-on-api/108119)._
