Summary
In the payload of an incoming webhook, specifying a user results in error 500 "Couldn't find the channel"
Steps to reproduce
- Create incoming webhook
- Open Firefox (or web browser with capability to POST and pass parameters)
- Use the URL of the webhook and post the suggested example in the documentation (Make sure to put application/json in the content type of the header):
{"text": "Hello, this is some text."}
- Message should appear in the channel
- Try again, but now add the channel property
{"channel":"@username","text": "Hello, this is some text."}
- Enter a valid user name in @username (leave the @ sign).
- Post will now fail with a 500 error and message "Couldn't find the channel"
- Changing channel property to a public channel works. Only with @username is not working.
Expected behavior
As per documentation, "the message will be sent to that user’s direct message channel"
Observed behavior
Returned JSON:{"id":"web.incoming_webhook.channel.app_error","message":"Couldn't find the channel","detailed_error":"","request_id":"8aajaxpkybn8mmm7t4nkefnrca","status_code":500}
Also, misspelling the username or putting an invalid username results in "Couldn't find the user". So maybe the problem is that there's no "channel" message for the user (as in Slack, the user can have private messages with themselves)