67P / hubot-incoming-webhook

Accept incoming Webhooks to write messages to a room/channel
9 stars 8 forks source link

Post to Mattermost #1

Closed zchef2k closed 8 years ago

zchef2k commented 8 years ago

What would it take to send these to a Mattermost incoming webhook?

raucao commented 8 years ago

This is a very simple plugin for just posting to any channel via an incoming hook to the Hubot instance it's used with. If Hubot supports Mattermost, then you could e.g. post to Mattermost channels via a custom hook.

zchef2k commented 8 years ago

I'm not doing something right, then. My mattermost adapter works, but should I expect to be able to post to the hubot incoming webhook URL and the message show up in the mattermost channel? When I post to the hubot webhook url I see mattermost throwing 404's. AFAIK, I've got this setup correctly per your example. I wonder if certain bits need to be adjusted for use with mattermost.

raucao commented 8 years ago

should I expect to be able to post to the hubot incoming webhook URL and the message show up in the mattermost channel?

Yes, that's how it should work.

When I post to the hubot webhook url I see mattermost throwing 404's

I'm not familiar with how Mattermost works, but I assume Hubot uses an HTTP API to connect to it? In that case, I would check what URL Hubot is trying to post to and why it's a 404.

I wonder if certain bits need to be adjusted for use with mattermost.

We only tested this plugin with the IRC adapter so far, so that's entirely possible. It's really just a few lines of code, so it should be rather straightforward to debug it live and see why it doesn't post to channels (and/or how it would work to post to channels).

zchef2k commented 8 years ago

Sorry to bug you with this. Thanks for your responses.

Anyone searching for this: use the channel id, not the display name, of the channel you want to post to in the "room:" field of the hubot-incoming-webhook request and it should work. You may need to obtain an API token for the hubot mattermost user beforehand. I'm still a bit confused on that detail.

raucao commented 8 years ago

use the channel id, not the display name, of the channel you want to post to in the "room:" field of the hubot-incoming-webhook request and it should work

That would actually be a good addition to the README, if it works for you! Wanna do a quick PR with that addition, for other people using Mattermost?

zchef2k commented 8 years ago

Done. (Yay! my first contribution to another project)

raucao commented 8 years ago

my first contribution to another project

reggie-awesome