Search code examples
ip-addressslack-apislack

How to get logged in user's IP in slack


I want to setup a slash command /ip that could give me the ip of current logged in user. I tried setting up same but whenever I try to use /ip it gives this as output which is definitely not my public ip(this keeps changing). it is actually giving ip of slack server's.

I am using this service to get ip. I know I can get the user's ip through this, but I want an alternate for this paid feature.

enter image description here


Solution

  • The Slash Command URL that you are hosting is invoked by the Slack Servers for you, in response to a message in your team. So the IP address that you are interpreting is that of the Slack Server and not of your machine.

    I am not sure if what you want to achieve is going to be possible since Slack Infrastructure is in the middle interpreting your commands and calling external integrations (like your Slash Command URL).