Search code examples
shellcurlslack

Create Slackbot reminder via Curl and Incoming Webook


We use the Incoming Webhook integration for Slack for a lot of chat-ops related things. What I'm trying to do is use this integration to be able to set a Slackbot reminder as part of a cron job on a server. Right now I have a curl that looks like:

curl --data "/remind aparkin to do that thing in 45 mins" 'https://notmyrealteam.slack.com/services/hooks/slackbot?token=nottherealtoken&channel=%23testtesttest2'

But this just literally puts the text /remind aparkin to do that thing in 45 mins in the #testtesttest2 room instead of creating the reminder.

I know the web api allows you to do this, but I really like the convenience of the incoming webhooks integration.

Any ideas?


Solution

  • Don't think you can do that directly with an incomming webhook.

    But you can develop a small script (e.g. PHP) that works as your very own webhook for the cron script. It just needs to parse the reminder parameter from your url and then use the remind method of the WEB API to set the reminder on Slack.