Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hubot services endpoint #1317

Closed
zubivan opened this issue Nov 2, 2015 · 6 comments
Closed

Hubot services endpoint #1317

zubivan opened this issue Nov 2, 2015 · 6 comments

Comments

@zubivan
Copy link

zubivan commented Nov 2, 2015

Hi All,

I'm trying to create a custom bot for TFS build notifications as they are supporting webhooks out of the box now. So, I've created a custom bot with the following signuture:

module.exports = (robot) ->
   robot.router.post '/hubot/tfs/:room', (req, res) ->
     room   = req.params.room
     data   = if req.body.payload? then JSON.parse req.body.payload else req.body

     robot.messageRoom room, "Incoming: #{data}"

     res.send 'OK'

What is a default url where hubot service is exposed for rocket.chat? Is it the same as root chat url or I should use a default hubot port 8080? Is there any way to configure it?

Regards,
Ivan

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@CrystalMethod
Copy link

I stumbled across the same issue. Any information would be really helpful.

@zubivan
Copy link
Author

zubivan commented Nov 5, 2015

Hi all,

So I made some further investigations, read some manuals and when I'm running hubot from terminal via

bin/hubot -a rocketchat

And if everything is configured properly you should be able to reach your bot via:

curl -X POST http://localhost:8080/hubot/tfsimport/GENERAL -d message=lala

Which should result in the following log message from running bot:

[Thu Nov 05 2015 20:59:39 GMT+0000 (UTC)] INFO Sending Message To Room: GENERAL
[Thu Nov 05 2015 20:59:39 GMT+0000 (UTC)] INFO Change received on ID f2ihRqLmEe3MfDyQW

So in the end I've connected it to TFS via web-hooks:
screen shot 2015-11-05 at 22 21 12

P.S. Omg folks, why room name is case sensitive?

@geekgonecrazy
Copy link
Contributor

@zubivan TFS as in Visual Studio Team Services previously Visual Studio Online? I'd love to see this integration. I use it occasionally at my day job.

Also the names have to be unique this is why they are case sensitive.

@engelgabriel
Copy link
Member

Relates to #2426

@engelgabriel
Copy link
Member

Please see initial documentation at https://github.com/RocketChat/Rocket.Chat/wiki/WebHook-Scripting---GitHub

@geekgonecrazy
Copy link
Contributor

Closing. Looks like issue was resolved. Please see our hubot adapter repo: https://github.com/rocketchat/hubot-rocketchat or our webhook documentation https://rocket.chat/docs/administrator-guides/integrations/

bhardwajaditya pushed a commit to bhardwajaditya/Rocket.Chat that referenced this issue Oct 13, 2022
…ut_method_body

[IMPROVE] Simplify API Users PUT Method Body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants