question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Change the username of incoming webhook message

See original GitHub issue

I use the following code snippet to send notification message to an incoming webhook URL:

from slack_sdk.webhook import WebhookClient

webhook_url = "https://hooks.slack.com/services/T0..."
webhook_sync = WebhookClient(webhook_url)
response = webhook_sync.send(text="Test notification")

My question is how can I specify the username of that message like Gitlab does on its slack notification settings? I couldn’t find any parameter to do that.

2022-10-06_10-24

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
seratchcommented, Oct 6, 2022

@agn-7 Thanks for the reply. So, in this case,

The username parameter used to be available for legacy incoming webhooks: https://my.slack.com/apps/A0F7XDUAZ-incoming-webhooks

as I mentioned above, you can still create the legacy webhook, which supports username and other parameters. It’s not recommended from a long-term maintenance perspective, but it works for now (and at least until the sunset of legacy custom integrations although we haven’t decided anything on the timeline).

Since we don’t have anything further to share on this topic, let us close this issue now. Thanks again for writing in!

0reactions
seratchcommented, Oct 18, 2022

@agn-7 Utilizing a Web API such as chat.postMessage is completely different from Incoming Webhooks. Please refer to the document for more details: https://slack.dev/python-slack-sdk/web/index.html

Read more comments on GitHub >

github_iconTop Results From Across the Web

Override Incoming Webhook Username - Mattermost Forum
What determines an incoming webhook's username? Can this be changed?
Read more >
Sending messages using Incoming Webhooks - Slack API
Incoming Webhooks are a simple way to post messages from apps into Slack. Creating an Incoming Webhook gives you a unique URL to...
Read more >
Incoming WebHook and dynamic user-name/channel
If you want to send message to any channel with a custom username your best option is to use the Slack API with...
Read more >
Get User email in Action Card in Incoming Webhook in Teams ...
Users in the Teams channel can do the actions with this message. (Add a comment, Set a due date, Change status). I want...
Read more >
Incoming Webhooks — Mattermost 4.0 documentation
(Optional) Configure the Enable integrations to override usernames option to allow external applications to post messages under any name. If not enabled, the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found