Post to Slack from Drafts

I feel like I am missing something simple here but I can’t figure this out.

I would like to write a message in drafts and have a Drafts action that prepends @channel and then posts my message in the specified channel.

Any thoughts on how to do this? Right now I am kicking off a Shortcut from Drafts but I can only get to the point of being in the correct channel and having my message on the clipboard which I have to paste and post. Not the end of the world, but I would still like to avoid that.

If you want a purely Drafts solution, Slack has a web API, so you should be able to create a Drafts action that accesses the API and posts directly from Drafts. I don’t see any in the Drafts Action Directory currently, but a quick look through the documentation didn’t flag up any obvious issues.

The HTTP, HTTPresponse, and Credential scripting objects are the ones you would use to interact with the API.

As per the API docs, register for an app token (you could keep that as a credential), build the JSON for posting your message (there are examples on the main page of the API documentation), push the data up (HTTP), and evaluate the response (HTTPresponse).

Hope that helps.

1 Like

Thank you for the detailed response. This is well beyond my current skill set but you provided me with enough help to start me on the right path so I can learn this new skill. Thanks again!