I'm attempting to invoke my api which is self hosted via ngrok. ngrok is working correctly because I can open the external https site in my browser and it loads up.
So, what do I have
slack form:
var request = require('request');
var RegisterMsgBuilder = function () { }
RegisterMsgBuilder.prototype.build = function (data) {
return {
"text": "Would you like to play a game?",
"attachments": [
{
"text": "Choose a game to play",
"fallback": "You are unable to choose a game",
"callback_id": "wopr_game",
"color": "#3AA3E3",
"attachment_type": "default",
"actions": [
{
"name": "game",
"text": "Chess",
"type": "button",
"value": "chess"
},
{
"name": "game",
"text": "Falken's Maze",
"type": "button",
"value": "maze"
},
{
"name": "game",
"text": "Thermonuclear War",
"style": "danger",
"type": "button",
"value": "war",
"confirm": {
"title": "Are you sure?",
"text": "Wouldn't you prefer a good game of chess?",
"ok_text": "Yes",
"dismiss_text": "No"
}
}
]
}
]
}
};
exports.RegisterMsgBuilder = RegisterMsgBuilder;
this produces a form in slack with 3 buttons.
I've set up interactive components with the following url: https://xyz.ngrok.io/api/values
this url points to a new asp.net webapi project. I've not changed anything in here. Its got a controller which looks like:
namespace WebApplication2.Controllers
{
public class ValuesController : ApiController
{
// GET api/values
public IEnumerable<string> Get()
{
return new string[] { "value1", "value2" };
}
// GET api/values/5
public string Get(int id)
{
return "value";
}
// POST api/values
public void Post()
{
int x = 66;
}
}
}
clicking on a button in my slack message does nothing. How come?