Slash commands, headers and JSON

Hello,

Is there any hope for JSON support in the slash commands in the future? For some reason all other integrations use JSON but slash commands form-urlencoded as the data format. Many external apps only accept JSON as the format, so that seriously limits the usefulness of the slash commands at the moment.

And, is there any way to configure the headers the slash commands send in requests? I have been randomly playing around with one problem related to them for a year or two but seems like no development has still happened at either side.

Basically, Microsoft Automate (Flow) is answering 401 to any request that has Authorization header in it, and I haven’t found any way to either tell Mattermost to not send the header or to Flow to ignore it. I can work around that by sending the request first to an intermediate web server, strip the header and format the request to JSON with a script but that’s ugly, adds one more breaking component and requires extra work every time to create any simple slash-command integration.

Hi stnz,

As for now I do not see that this has changed, but I think the custom slash commands might get replaced in the future by the apps framework or a simple app that supports what the custom slash commands do nowadays.
Using the self hosted intermediate app is in my opinion the only solution for the time being to get things done the way you want and if it’s written generic (f.ex. by adding the url to be called in the request url parameter), it could be a generic wrapper for all your outgoing slash commands which also could bring some benefit like tracking the usage of slash commands, being able to log inputs/errors, etc.

Furthermore this application could also be used as the receiver point for the return values of the slash commands and could therefore work as a guarded reverse proxy to your Mattermost server, if need be.

From what I understood, the Apps framework would allow you to install an app which exactly does what your intermediate script is currently doing, but in a more integrated and future-proof way.

Here’s a quick start guide to writing apps.