OneSignal
| Schemes | onesignal:// |
| Cargo feature | service-onesignal |
| Service | https://onesignal.com |
| Body formats | text (first is the default) |
| Attachments | no |
| Title length | 250 characters |
| Body length | 32,768 characters |
| Body lines | unlimited |
| Request throttle | none |
| Vendor URLs accepted | no |
URL formats
{schema}://{app}@{apikey}/{targets}
{schema}://{template}:{app}@{apikey}/{targets}
{schema} is one of onesignal://.
URL tokens
| Token | Meaning | Type | Required | Default | Notes |
|---|---|---|---|---|---|
{apikey} | API Key | string | yes | secret | |
{app} | App ID | string | yes | secret | |
{target_email} | Target Email | no | |||
{target_player} | Target Player ID | string | no | ||
{target_segment} | Include Segment | string | no | prefix # | |
{target_user} | Target User | string | no | prefix @ | |
{targets} | Targets | list | yes | any of target_email, target_player, target_segment, target_user; separated by / | |
{template} | Template | string | no | secret |
Query parameters
| Parameter | Meaning | Type | Default | Notes |
|---|---|---|---|---|
batch | Batch Mode | bool | no | |
contents | Enable Contents | bool | yes | |
decode | Decode Template Args | bool | no | |
image | Include Image | bool | yes | |
language | Language | string | en | also lang |
subtitle | Subtitle | string | ||
template | Template | string | sets {template} | |
to | Targets | list | sets {targets} |
Prefixed parameters:
:name=value: Custom Data+name=value: Postback Data
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):
onesignal://appid@apikey/playerid
onesignal://appid@apikey/user@email.com/#seg/player/@user/%20/a
onesignal://appid@apikey/@user?image=no
onesignal://appid@apikey/@user1/@user2/pid1?batch=no
onesignal://appid@apikey/@user1/@user2/#seg1/#seg2/pid1/pid2/a@b.com/c@d.com?batch=yes
onesignal://templateid:appid@apikey/@user/?contents=no
onesignal://appid@apikey/playerid/?lang=es&subtitle=Sub
onesignal://templateid:appid@apikey/@user/?:par=b64:eyJhIjogMX0=
Rejected URLs:
onesignal://
onesignal://:@/
onesignal://apikey/
onesignal://appid@%20%20/
Send one from the command line:
mercurio -t 'Backup' -b 'Finished in 42s' 'onesignal://appid@apikey/playerid'
Notes
OneSignal (onesignal://): push notifications through the OneSignal API.