# \[SOLVED\] Interactive Message Buttons

**URL:** <https://forum.mattermost.com/t/solved-interactive-message-buttons/4669>\
**Category:** Troubleshooting\
**Created:** [March 21, 2018, 4:59am UTC](https://forum.mattermost.com/t/solved-interactive-message-buttons/4669 "2018-03-21T04:59:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![shekharkoirala](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/shekharkoirala/32/1957_2.png) [@shekharkoirala](https://forum.mattermost.com/u/shekharkoirala)\
**Post date:** [March 21, 2018, 4:59am UTC](https://forum.mattermost.com/t/solved-interactive-message-buttons/4669/1 "2018-03-21T04:59:24Z")

</div>

From the [documentation](https://docs.mattermost.com/developer/interactive-message-buttons.html)  
we can see that they show the way to add an update  
The integration can respond with an update to the original post, or with an ephemeral message:  
But where to add this ?  
{  
“update”: {  
“message”: “Updated!”  
},  
“ephemeral\_text”: “You updated the post!”  
}

---

<div class="post-metadata">

**Author:** ![jespino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/jespino/32/7350_2.png) [@jespino](https://forum.mattermost.com/u/jespino)\
**Post date:** [March 23, 2018, 12:25pm UTC](https://forum.mattermost.com/t/solved-interactive-message-buttons/4669/2 "2018-03-23T12:25:32Z")

</div>

Hi shekharkoirala,

The interactive buttons are defined with an url per action and some context, when you click in the action, the server call the url with the context information and the userId. You need to have an endpoint to manage that information and reply with that data. {“update”: {“message”: “Updated!”}} or {“ephemeral\_text”: “You updated the post!”}

---

<div class="post-metadata">

**Author:** ![marben5](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@marben5](https://forum.mattermost.com/u/marben5)\
**Post date:** [March 23, 2018, 2:15pm UTC](https://forum.mattermost.com/t/solved-interactive-message-buttons/4669/3 "2018-03-23T14:15:50Z")

</div>

Thanks for the details OP. Glad to know about it.

---

<div class="post-metadata">

**Author:** ![shekharkoirala](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/shekharkoirala/32/1957_2.png) [@shekharkoirala](https://forum.mattermost.com/u/shekharkoirala)\
**Post date:** [April 4, 2018, 10:59am UTC](https://forum.mattermost.com/t/solved-interactive-message-buttons/4669/4 "2018-04-04T10:59:45Z")

</div>

hi jespino ,  
I created a button by this

```
{
 "name": "Button Name",
 "integration": {
            "url": "http://my_ip/getmessage",
            "context": {
            "action": "action_trigger_name"
            }

```

and a flask app to capture the action. It is captured but  
while calling this function

```
@app.route("/getmessage",methods=["POST"]) 
def afunction(value):
      payload = {
        "channel": "testchannel",
        "username": "lunch-bot",
        "response_type": "ephemeral",
        "icon_url": "a url",
        "text" : "some text"
      } 
      url = 'incoming webhooks url'
      headers = {'content-type': 'application/json'}
      r = requests.post(url, data = json.dumps(payload) , headers = headers)

```

It post the data  
But it is not ephemeral ( only visible to you )  
so , i am not getting what i want.

---

<div class="post-metadata">

**Author:** ![amy.blais](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/amy.blais/32/7481_2.png) [@amy.blais](https://forum.mattermost.com/u/amy.blais)\
**Post date:** [May 4, 2018, 12:09am UTC](https://forum.mattermost.com/t/solved-interactive-message-buttons/4669/5 "2018-05-04T00:09:58Z")

</div>

Hi @shekharkoirala, just following up on this - has this been resolved or are you still having trouble with interactive message buttons? If you need further assistance I will ask one of our engineers to take a look.

---

<div class="post-metadata">

**Author:** ![shekharkoirala](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/shekharkoirala/32/1957_2.png) [@shekharkoirala](https://forum.mattermost.com/u/shekharkoirala)\
**Post date:** [May 4, 2018, 10:11am UTC](https://forum.mattermost.com/t/solved-interactive-message-buttons/4669/6 "2018-05-04T10:11:06Z")

</div>

return jsonify(ephemeral\_text=‘Your response has been updated.’)

thanks @jespino for the edt months ago. it is solved by using above return method on the callback URL.

---

<div class="post-metadata">

**Author:** ![Fabianski-tr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/fabianski-tr/32/2054_2.png) [@Fabianski-tr](https://forum.mattermost.com/u/Fabianski-tr)\
**Post date:** [June 21, 2018, 10:06am UTC](https://forum.mattermost.com/t/solved-interactive-message-buttons/4669/7 "2018-06-21T10:06:33Z")

</div>

it is possible to create something similar but with Hubot and the actions of the buttons?
