Rocket.chat: Send message from command line

Created on 26 Apr 2016  路  9Comments  路  Source: RocketChat/Rocket.Chat

Hi Im writing here cause i dont know any better place to do it, please if this is not the place tell me where to post this question.

I want to send notifications to Rocket.Chat channels from a computer shell command line with a xmpp client or something like that.
How can I accomplish this? I mean... what protocol or way of connection do I have available in Rocket.Chat to do that? It's xmpp or any other available?

Thanks in advance.

Most helpful comment

thanks for quick ride @bt
but one more problem i have... How do i send multi-lines message using the curl 馃槥

my case here, involves "machine generated multiple line text messages" not just "text":"Example message"

thanks for the example, i am not the admin but now I know the process 馃槈
example

All 9 comments

I would suggest you create a new integration, then using something like cURL to make the request.

From Administration > Integrations

Create a new Incoming Webhook

Fill in the information, and at the end, it should give you an example cURL command line.

Thank you very much for your kind help. This was of great help and solved the issue.

any quick examples on the the curl url and params ? @bt @iojeda

Go to your Rocket.Chat instance, login as an administrator and then click your username on the top right and choose Administration:

1

In the Administration menu, choose Integrations:

2

Create a New Integration:

3

You want to send messages to Rocket.Chat via cURL, so choose Incoming WebHook:

4

Fill in the details as requested:

5

Save your changes:

6

Under Example box, you should suddenly get a cURL example:

7

@zerOnepal

thanks for quick ride @bt
but one more problem i have... How do i send multi-lines message using the curl 馃槥

my case here, involves "machine generated multiple line text messages" not just "text":"Example message"

thanks for the example, i am not the admin but now I know the process 馃槈
example

@zerOnepal I guess the admin just needs to give you a token with permissions to write to a channel.

I believe text is actually HTML-based (I might be wrong though).

Try something like:

"text": "Multi-line<br />Text"

and see if it works! 馃槃

hey check this out, one stop solution to :allthethings:
https://github.com/course-hero/slacktee

Thank you @bt @thapakazi that was helpful. 馃殌

Why would I use an incoming webhook instead of using the REST API directly? I'm just curious, because I've recently written a small Python script which uses the API, and from the looks of it, the webhook seems more cumbersome to set up and less flexible.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

neha1deshmukh picture neha1deshmukh  路  3Comments

brendanheywood picture brendanheywood  路  3Comments

Kiran-Rao picture Kiran-Rao  路  3Comments

engelgabriel picture engelgabriel  路  3Comments

amayer5125 picture amayer5125  路  3Comments