1

I have a snooze select button on my message attachment.

actions: [
   {
      name: 'snoozeTime',
      text: 'Select a time...',
      type: 'select',
      options: [
        {
            text: '1 Hour',
            value: '1hour'
        },
        {
            text: '4 Hours',
            value: '4'
        },
        {
            text: '24 Hours',
            value: '24hours'
        },
        {
            text: 'Custom',
            value: 'custom'
        }
      ]
  }
]

I want to redirect the user to my web page to choose the custom snooze time. Please tell me how could I achieve it?

Thanks

Quy Tang
  • 3,929
  • 1
  • 31
  • 45

2 Answers2

4

By the way, this is now supported in the slack platform. Slack Link Buttons

{
  "text": "<@W1A2BC3DD> approved your travel request. Book any airline you like by continuing below.",
  "channel": "C061EG9SL",
  "attachments": [
    {
      "fallback": "Book your flights at https://flights.example.com/book/r123456",
      "actions": [
        {
          "type": "button",
          "name": "travel_request_123456",
          "text": "Book flights ",
          "url": "https://flights.example.com/book/r123456",
          "style": "primary"
        },
        {
          "type": "button",
          "name": "travel_cancel_123456",
          "text": "Cancel travel request",
          "url": "https://requests.example.com/cancel/r123456",
          "style": "danger"
        }
      ]
    }
  ]
}
CantGetANick
  • 1,799
  • 15
  • 25
2

Slack does not support an automatic redirect to a 3rd party website. I talked with Slack support about this feature some weeks ago and they said they discussed it internally, but would not support it at this time because of security concerns.

Your only option currently (and the one I have chosen for my apps, e.g. Rafflebot) is to show a custom link to the the user (as part of a slack message or attachment), which the user has to click and which then opens your website. This is a bit ugly, but it works.

Or you could wait for the upcoming "input box" feature that Slack has promised to implement. You find it under "Interactive message stage 3" on the Slack Platform Roadmap. I am not aware of any timeline, but its flagged as "Near term".

Erik Kalkoken
  • 30,467
  • 8
  • 79
  • 114