Mattermost
| Schemes | mmost://, mmosts:// |
| Cargo feature | service-mattermost |
| Service | https://mattermost.com/ |
| Body formats | text (first is the default) |
| Attachments | yes |
| Title length | no title (merged into the body) |
| Body length | 4,000 characters |
| Body lines | unlimited |
| Request throttle | none |
| Vendor URLs accepted | yes |
URL formats
{schema}://{host}/{token}
{schema}://{host}:{port}/{token}
{schema}://{host}/{fullpath}/{token}
{schema}://{host}:{port}/{fullpath}/{token}
{schema}://{user}@{host}/{token}
{schema}://{user}@{host}:{port}/{token}
{schema}://{user}@{host}/{fullpath}/{token}
{schema}://{user}@{host}:{port}/{fullpath}/{token}
{schema} is one of mmost://, mmosts://.
URL tokens
| Token | Meaning | Type | Required | Default | Notes |
|---|---|---|---|---|---|
{fullpath} | Path | string | no | ||
{host} | Hostname | string | yes | ||
{port} | Port | int, 1 to 65535 | no | ||
{target_channel} | Target Channel | string | no | prefix # | |
{target_channel_id} | Target Channel ID | string | no | ||
{targets} | Targets | list | no | any of target_channel, target_channel_id; separated by / | |
{token} | Token | string | yes | secret | |
{user} | User | string | no |
Query parameters
| Parameter | Meaning | Type | Default | Notes |
|---|---|---|---|---|
botname | User | string | sets {user} | |
channel | Targets | list | sets {targets} | |
channels | Targets | list | sets {targets} | |
icon_url | Icon URL | string | ||
image | Include Image | bool | yes | |
mode | Mode | choice | webhook (usually; depends on the URL) | one of webhook, bot |
team | User | string | sets {user} | |
to | Targets | list | sets {targets} |
The common URL parameters (format, overflow, verify, redirect, cto, rto, retry, wait, store, tag, tz, user, password, port, optional, emojis) apply as well.
Examples
Accepted URLs (tokens are fake):
mmost://localhost/3ccdd113474722377935511fc85d3dd4
mmosts://localhost/a/path/3ccdd113474722377935511fc85d3dd4
mmosts://localhost/////3ccdd113474722377935511fc85d3dd4///
https://mattermost.example.com/hooks/3ccdd113474722377935511fc85d3dd4
mmost://localhost/token?mode=w
mmost://localhost/3ccdd113474722377935511fc85d3dd4?to=#raw
mmost://localhost/3ccdd113474722377935511fc85d3dd4?image=no
http://mattermost.example.com:8065/hooks/3ccdd113474722377935511fc85d3dd4/?image=no
Rejected URLs:
mmost://
mmosts://
mmost://:@/
mmosts://localhost
Send one from the command line:
mercurio -t 'Backup' -b 'Finished in 42s' 'mmost://localhost/3ccdd113474722377935511fc85d3dd4'
Notes
Mattermost (mmost://, mmosts://): posts to Mattermost channels.
Channel-name lookups (bot mode) are cached in the persistent store for 20 days (c:<name>).