# Real time message with websocket

**URL:** <https://forum.mattermost.com/t/real-time-message-with-websocket/2571>\
**Category:** Troubleshooting\
**Created:** [December 2, 2016, 2:59pm UTC](https://forum.mattermost.com/t/real-time-message-with-websocket/2571 "2016-12-02T14:59:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yli](https://avatars.discourse-cdn.com/v4/letter/y/bbe5ce/32.png) [@yli](https://forum.mattermost.com/u/yli)\
**Post date:** [December 2, 2016, 2:59pm UTC](https://forum.mattermost.com/t/real-time-message-with-websocket/2571/1 "2016-12-02T14:59:11Z")

</div>

Hello everyone, i have a litte question:  
I m using websocket for native android mattermost app. I want the message to be in real time. I have already establish the connection, i have received the response. but how can i get the message with the help of websocket? Has anyone some examples pls? Thanks

---

<div class="post-metadata">

**Author:** ![hmhealey](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/hmhealey/32/1915_2.png) [@hmhealey](https://forum.mattermost.com/u/hmhealey)\
**Post date:** [December 5, 2016, 5:58pm UTC](https://forum.mattermost.com/t/real-time-message-with-websocket/2571/2 "2016-12-05T17:58:46Z")

</div>

Hi @yli,

When another user makes a post, you should receive a JSON-serialized message over the websocket like

```auto
{
    "event": "posted",
    "data": {
        "post": "{\"id\": \"1234\", \"message\": \"test message\"}" // a JSON-serialized Post object like you'd get from the API
    }
}

```

We’re working on proper documentation for our websocket API that will be available in a few days, but in the mean time, you can look [here](https://github.com/mattermost/platform/blob/master/webapp/actions/websocket_actions.jsx) for an example of how our web app handles them.
