Incoming Slack Webhook URL Components

10 Nov.,2023

 

Based on the incoming webhook alone (as a string) it's not possible, apart from the team_id mentioned in the comment above.

From my experience with only incoming-webhooks enabled and publicly distributed apps that information is available only in response after user installs the app with the standard OAuth process. Keep in mind that reponse will change depending of the scope of your application but if you ask for incoming-webhook you will get channel together with url which is incoming-webhook url. You will also get team_name and team_id which is Workspace info. You can find detailed explanation at https://api.slack.com/messaging/webhooks#incoming_webhooks_programmatic and https://api.slack.com/authentication/oauth-v2.

And here is an example of OAuth response json.

{
"ok": true,
"access_token": "xoxp-XXXXXXXX-XXXXXXXX-XXXXX",
"scope": "identify,bot,commands,incoming-webhook,chat:write:bot",
"user_id": "XXXXXXXX",
"team_name": "Your Workspace Name",
"team_id": "XXXXXXXX",
"incoming_webhook": {
    "channel": "#channel-it-will-post-to",
    "channel_id": "C05002EAE",
    "configuration_url": "https://workspacename.slack.com/services/BXXXXX",
    "url": "https://hooks.slack.com/TXXXXX/BXXXXX/XXXXXXXXXX"
}

So in the nutshell, as far as I know, there is no way to get information from webhook alone, but one other option, which is not directly the answer to the question is to expand your application and include web api permissions and then there is nothing stopping you to request that information independently from incoming-webhook directly from the workspace.

If you have any questions on how to get slack webhook url. We will give the professional answers to your questions.