How to integrate internal APIs (Not accessible outside office network) to slack slash commands

前端 未结 2 483
忘掉有多难
忘掉有多难 2020-11-30 15:37

I am trying to use slash commands to my one of the slack channel. I tried to do a POC using git API and it worked fine.

I first created a slash command from this lin

2条回答
  •  醉酒成梦
    2020-11-30 15:52

    If opening a connection into the internal network is not an option, there is another way that can allow communication with internal services by inverting the communication direction with a queue.

    To do this, you need to deploy a public endpoint that accepts the requests from Slack and puts them onto a queue (e. g. AWS Lambda + SQS, Flask + RabbitMQ) and then poll the queue from the internal network. The polling needs to happen fairly often (at least once a second) to ensure the communication is quick enough for the users not to notice the lag too much. By doing this you can avoid exposing any endpoint of the internal network.

    The drawbacks of this approach are more infrastructure complexity and slower response times, but it can be a good alternative in some corporate environments.

提交回复
热议问题