We're Hiring!

Mattermost, Inc.

Posting incoming webhook messages from a bot account

I’ve successfully set up an incoming webhook, and it posts from my user with the BOT label as documented. But I’d prefer that the webhook post as a dedicated user. I’ve created a new bot account for this purpose, but I see no way to configure the webhook to post as that bot account instead of from my account. Am I missing something? Thanks.

As far as I’m aware you should be able to do what your asking about. I briefly looked it up on the Mattermost documentation, and saw that the command below is provided to use for verifying a bot account has successfully been created:

curl -i -X POST -H 'Content-Type: application/json' -d '{"channel_id":"<channel-id>", "message":"This is a message from a bot", "props":{"attachments": [{"pretext": "Look some text","text": "This is text"}]}}' -H 'Authorization: Bearer <bot-access-token>' <mattermost-url>/api/v4/posts

Have you read the documentation here?

1 Like