# Automatically updates upon new message

**URL:** <https://forum.mattermost.com/t/automatically-updates-upon-new-message/2124>\
**Category:** Troubleshooting\
**Created:** [August 23, 2016, 3:31pm UTC](https://forum.mattermost.com/t/automatically-updates-upon-new-message/2124 "2016-08-23T15:31:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julia](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/julia/32/864_2.png) [@Julia](https://forum.mattermost.com/u/Julia)\
**Post date:** [August 23, 2016, 3:31pm UTC](https://forum.mattermost.com/t/automatically-updates-upon-new-message/2124/1 "2016-08-23T15:31:56Z")

</div>

Is there an api call that will update me when a new post has been received by the server so I can display it to the relevant recipients?

If not, how can I tell when a user has sent a message so that I can add his message to the screen?

Can I get an example on how to use websockets?

---

<div class="post-metadata">

**Author:** ![crspeller](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/crspeller/32/2605_2.png) [@crspeller](https://forum.mattermost.com/u/crspeller)\
**Post date:** [August 26, 2016, 12:27pm UTC](https://forum.mattermost.com/t/automatically-updates-upon-new-message/2124/2 "2016-08-26T12:27:20Z")

</div>

Hi Julia,

Websockets would be the best way to accomplish this. You can see how they work in our example bot here: [https://github.com/mattermost/mattermost-bot-sample-golang/blob/master/bot\_sample.go](https://github.com/mattermost/mattermost-bot-sample-golang/blob/master/bot_sample.go)
