3

Is there a way to make a REST API call from Slack? I can use Slash Commands to make GET/POST requests, but it seems I can't pass additional header parameters in the header.

I am trying to invoke a remote Jenkins script which requires passing the API token to authenticate the user. I don't want to write a middleware service between Slack and Jenkins.

mahemoff
  • 44,526
  • 36
  • 160
  • 222
Rami Enbashi
  • 3,526
  • 1
  • 19
  • 21

2 Answers2

0

The bad news is it does require middleware, because Slack POSTs a specific body format which is beyond your control, so Jenkins' REST API wouldn't understand it.

The good news is there's already a Slack command for Jenkins. It looks to be Heroku-specific, but you should be able to make it work on any server.

mahemoff
  • 44,526
  • 36
  • 160
  • 222
0

I ended up writing a Node.js middleware.

Rami Enbashi
  • 3,526
  • 1
  • 19
  • 21