Skip to content

Notify_rocketchat

lead2gold edited this page Nov 30, 2017 · 11 revisions

Rocket.Chat Notifications

  • Source: https://rocket.chat/
  • Icon Support: No
  • Message Format: Text
  • Message Limit: 32768 Characters per Message

Syntax

Valid syntaxes are as follows:

  • rocket:://{user}:{password}@{hostname}/#{channel}
  • rocket:://{user}:{password}@{hostname}:{port}/#{channel}
  • rocket:://{user}:{password}@{hostname}/{room_id}
  • rocket:://{user}:{password}@{hostname}:{port}/{room_id}
  • rockets:://{user}:{password}@{hostname}/#{channel}
  • rockets:://{user}:{password}@{hostname}:{port}/#{channel}
  • rockets:://{user}:{password}@{hostname}/{room_id}
  • rockets:://{user}:{password}@{hostname}:{port}/{room_id}

You can also form any combination of the above and perform updates from one url:

  • rocket:://{user}:{password}@{hostname}/#{channel_id}/{room_id}

If neither a {room_id} or #{channel} is specified then this notification will fail.

Secure connections (via https) should be referenced using rockets:// where as insecure connections (via http) should be referenced via rocket://.

Parameter Breakdown

Variable Required Description
user Yes The user identifier you've associated with your Rocket.Chat server.
password Yes The password identifier you've associated with your Rocket.Chat server.
hostname Yes The Rocket.Chat server you're sending your notification to.
port No The port the Rocket.Chat server is listening on. By default the port is 80 for rocket:// and 443 for all rockets:// references.
room_id No A room identifier.
channel No Channels must be prefixed with a hash (#) or they will be interpreted as a room_id. Channels must be registered with your Rocket.Chat server to work.

Example

Send a Rocket.Chat notification to the channel #nuxref:

# Assuming our {user} is l2g
# Assuming our {password} is awes0m3!
# Assuming our {hostname} is rocket.server.local
notify rocket://l2g:awes0m3!@rocket.server.local/#nuxref

Setup

Here is how i set up a quick rocket.chat server to test against. This may or may not be useful to other people.

Docker

Based on this source:

# Docker (assuming a connection to docker.io)
sudo docker pull rocket.chat
sudo docker pull mongo:3.0

sudo docker run --name db -d mongo:3.0 --smallfiles
sudo docker run --name rocketchat -p 80:3000 --env ROOT_URL=http://$(hostname) --link db -d rocket.chat
# Then visit http://server.you.ran.these.commands.on
Clone this wiki locally