WeChat (WeCom)
| Schemes | wechat:// |
| Cargo feature | service-wechat |
| Service | https://work.weixin.qq.com/ |
| Body formats | text (first is the default) |
| Attachments | no |
| Title length | no title (merged into the body) |
| Body length | 2,048 characters |
| Body lines | unlimited |
| Request throttle | none |
| Vendor URLs accepted | no |
URL formats
{schema}://{user}:{password}@{host}
{schema}://{user}:{password}@{host}/{targets}
{schema} is one of wechat://.
URL tokens
| Token | Meaning | Type | Required | Default | Notes |
|---|---|---|---|---|---|
{host} | Agent ID | string | yes | must match ^[0-9]+$ | |
{password} | App Secret | string | yes | secret | |
{target_department} | Target Department | string | no | prefix # | |
{target_tag} | Target Tag | string | no | prefix + | |
{target_user} | Target User | string | no | prefix @ | |
{targets} | Targets | list | no | any of target_department, target_tag, target_user; separated by / | |
{user} | Corp ID | string | yes |
Query parameters
| Parameter | Meaning | Type | Default | Notes |
|---|---|---|---|---|
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):
wechat://corpid:secret@1000002/johndoe
wechat://corpid:secret@1000002/user1/user2/user3
wechat://corpid:secret@1000002/john/%23200/+3/bad!target
wechat://corpid:secret@1000002?to=@all
wechat://corpid:secret@1000002/@all?format=markdown
Rejected URLs:
wechat://
wechat://corpid
wechat://corpid:secret@
wechat://corpid:secret@notanumber
Send one from the command line:
mercurio -t 'Backup' -b 'Finished in 42s' 'wechat://corpid:secret@1000002/johndoe'
Notes
WeChat / WeCom (wechat://): messages through the WeCom application API.
The access token is kept in the persistent store for expires_in minus five minutes (at least a minute) and dropped when the API reports it expired (errcode 40001, 40014, 42001).