Open slack dialog by external app - slack

The slack docs state that dialog's can be invoked using slash commands and buttons.
Is there however a way to not use either ? I would want my app to prompt user with a dialog. One option I found possible is to send a button via incoming web hooks or postMessage attachment than user clicks the button and opens a dialog but this seems like a needless step.
Another was to invoke the dialog via slash command but i cant find a way to invoke a slash comma d ia web api.

No. At least at the moment it is only possible in two ways:
With a slash commmand
With an interactive message
Both generate a trigger ID for the user, which is required to start your dialog and only valid for 3 seconds.
Source

Related

Using Slack slash command to run local app

I want to write a Slack command to open Skype For Business (SfB).
The command will be something along the lines of:
/sfb my.colleague#company.com
SfB recognises the sip protocol, so I can type sip:my.colleague#company.com in my browser and it will open a conversation with my colleague in SfB.
However, on inspection of the Slack Integration pages, it seems that commands have to call a public url starting with http://.
There is an official Skype command for Slack, so I assume that what I'm trying to do is possible, and I'm just missing a step.
Slash commands work a bit differently.
Once a users issues your slash command, the request URL you specified will receive a special HTTP POST request from Slack (see here). You need an app running on that request URL (e.g. a Python script) that understands the format of the the slash request coming from Slack. And that URL needs to be reachable from the public Internet.
You can however open URLs on your local browser through Slack, albeit not in one step. Here is how it could work:
Use enters slash command
App responds with a message containing text link or link button, with your sip link.
User clicks on the link

How to combine slash commands, buttons and dialogs for a menu?

My Slack app is started with a slash command, which then posts an ephemeral menu message to the user. That menu has some information and three message buttons.
Example:
First button allows the user to close the menu
Second button allows the user to start an action
Third button allows the user to open a dialog for changing
options.
After the user submits the dialog I want to update the menu message to reflect the changes made in the dialog.
However, after the user submits the dialog I can no longer to update the message menu by responding to a Slack response as before.
How can I update the menu message with the changes?
In order to keep the connection with the initial slash command one needs to store the response_url of the last interactive action before opening the dialog.
In this example it will be in the interactive action request initiated after pressing the "Options" button. That response_url allows one to seamlessly continue the conversation that was started with the initial slash command.
The easiest approach for storing the response_url is to put it into the state property of the dialog, which will automatically be echoed back to the app with the dialog submission request.
One needs to be careful not to confuse the response_url from the interactive action with the response_url from the dialog.
Also, the dialog cancel case is automatically handled, since in that case the user can continue working with the initial menu message.

create a slack message and edit before sending

I have created a bot using Botkit and am working on creating an interactive message. What I want to do is when the user clicks on the button in the interactive message, a new message will be created pulling som info from the original interactive message, BUT WILL NOT BE SENT. I need to continue editing the message before choosing to send it. Does anybody know whether this is possible or not? I have been googling and searching slack's docs and botkit's docs, but haven't been able to find an answer.
If you want to let the user edit a message before sending you can use the Dialog feature from Slack. It will allow you to show an input text field, where the user can make his edits. I am not familiar with Botkit though and can not say if it supports Dialogs.

Slack respond to dialog submission with another dialog

Is there any way in the Slack API to have the submission button of a dialog open a new dialog or edit the current one?
Not directly. You can use the response_url attached to the dialog submission sent to your server to then post a follow up ephemeral message to the user, containing a button to continue to the next dialog. Once clicked, you'll receive another trigger_id which you can send to dialog.open and start another dialog.
More information on triggers and where to find them can be found here.

Logic to use an API

I am using the MessageSave API to execute my .exe. My .exe takes the first argument from MessageSave API and does my work. When the user selects multiple messages and presses the button in the MessageSave software then the API sends multiple pings to my .exe but I want to execute my .exe when the last message is saved (meaning on the last ping). Can you please help me to write this coding logic?
About MessageSave: Message save is an AddIn for outlook on following url: http://www.techhit.com/messagesave/
API Link: http://www.techhit.com/messagesave/api.html
MessageSave does not provide any option for MultiMessages.
You will need to start on the first one, then the others can use one of the many forms of IPC (DDE, SendMessage with WM_COPYDATA, COM, etc) to pass the filename to the first copy.
From your description, there is no indication of first/last message so you can not get this notification.

Resources