!!! info ""
rocketchat://[username
@]rocketchat-host
/token
[/channel
|@recipient
]*
--8<-- "docs/services/rocketchat/config.md"
-
Open up the chat Administration by clicking on Administration menu
-
Fill in the information for the webhook and click Save. Please don't forget to Enable your integration.
-
If you did everything correctly, Rocket.chat will give you the URL and Token to your newly created webhook.
-
Format the service URL
rocketchat://your-domain.com/8eGdRzc9r4YYNyvge/2XYQcX9NBwJBKfQnphpebPcnXZcPEi32Nt4NKJfrnbhsbRfX
└────────────────────────────────────────────────────────────────┘
token
Rocket.chat provides functionality to post as another user or to another channel / user, compared to the webhook configuration.
To do this, you can add a sender and/or channel / receiver to the service URL.
rocketchat://shoutrrrUser@your-domain.com/8eGdRzc9r4YYNyvge/2XYQcX9NBwJBKfQnphpebPcnXZcPEi32Nt4NKJfrnbhsbRfX/shoutrrrChannel
└──────────┘ └────────────────────────────────────────────────────────────────┘ └─────────────┘
sender token channel
rocketchat://shoutrrrUser@your-domain.com/8eGdRzc9r4YYNyvge/2XYQcX9NBwJBKfQnphpebPcnXZcPEi32Nt4NKJfrnbhsbRfX/@shoutrrrReceiver
└──────────┘ └────────────────────────────────────────────────────────────────┘ └───────────────┘
sender token receiver
If you want to, you also have the possibility to pass parameters to the send
function.
The following example contains all parameters that are currently supported.
params := (*types.Params)(
&map[string]string{
"username": "overwriteUserName",
"channel": "overwriteChannel",
},
)
service.Send("this is a message", params)
This will overwrite any options, that you passed via URL.
For more Rocket.chat Webhooks options see official guide.