Google Chat
| Schemes | gchat:// |
| Cargo feature | service-googlechat |
| Service | https://chat.google.com/ |
| Body formats | markdown (first is the default) |
| Attachments | no |
| 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}://{workspace}/{webhook_key}/{webhook_token}
{schema}://{workspace}/{webhook_key}/{webhook_token}/{thread_key}
{schema} is one of gchat://.
URL tokens
| Token | Meaning | Type | Required | Default | Notes |
|---|---|---|---|---|---|
{thread_key} | Thread Key | string | no | secret | |
{webhook_key} | Webhook Key | string | yes | secret | |
{webhook_token} | Webhook Token | string | yes | secret | |
{workspace} | Workspace | string | yes | secret |
Query parameters
| Parameter | Meaning | Type | Default | Notes |
|---|---|---|---|---|
key | Webhook Key | string | sets {webhook_key} | |
thread | Thread Key | string | sets {thread_key}; also threadkey | |
token | Webhook Token | string | sets {webhook_token} | |
workspace | Workspace | string | sets {workspace} |
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):
gchat://workspace/key/token
gchat://workspace/key/token/thread123
gchat://workspace/key/token/thr?thread=
gchat://workspace/key/token?format=text
https://chat.googleapis.com/v1/spaces/myworkspace/messages?key=mykey&token=mytoken
gchat://?workspace=ws&key=mykey&token=mytoken
gchat://a/b/c?workspace=ws&key=my%2Bkey&token=mytoken
https://chat.googleapis.com/v1/spaces/myworkspace/messages?key=mykey&token=mytoken&threadKey=mythreadkey
Rejected URLs:
gchat://
gchat://:@/
gchat://workspace
gchat://workspace/key/
Send one from the command line:
mercurio -t 'Backup' -b 'Finished in 42s' 'gchat://workspace/key/token'
Notes
Google Chat (gchat://): messages to a Google Chat space through a webhook.