Additional message fields
Additional fields are used to convey extra information, modify client behavior, etc.
Extras are stored in a key-value schema and are accepted only in POST /message requests with the content type application/json.
Namespaces
Section titled “Namespaces”Keys under .extras must be in the following format: <top-namespace>::[<sub-namespace>::]<action>.
Some of the namespaces are used by official clients:
| Namespace | Description |
|---|---|
client::* | Reserved |
client::display | Alters how the client displays information |
client::notification | Configures notification |
android::* | Reserved |
android::action | Responds to events |
ios::* | Reserved |
server::* | Reserved |
| All others | Defined by end users |
client::display
Section titled “client::display”contentType
Section titled “contentType”Definition
Section titled “Definition”| contentType | description |
|---|---|
text/plain | Default; the message will be displayed as plain text. Links may be highlighted and interactive. |
text/markdown | The message should be rendered as markdown. HTML must be ignored. |
Note: Markdown supports displaying images via
, these images will be automatically loaded when viewing the message. Similar to why remote content is blocked by default in mail clients, automatic loading of remote images can be used to collect information from the user.Also, if part of the message is interpolated from a malicious external source, an attacker may inject malformed markdown that results in information disclosure.
It is recommended to use
text/plainto reduce potential security issues when using text from external sources such as script output.
Example
Section titled “Example”{ "extras": { "client::display": { "contentType": "text/plain" } }}Support
Section titled “Support”| Client | since | description |
|---|---|---|
| Notifly Web UI | v2.0.5 | Uses GitHub Flavored Markdown |
| Notifly Android | v2.0.7 | Uses commonmark-spec |
client::notification
Section titled “client::notification”click.url
Section titled “click.url”click.url (string): opens a URL when the notification is clicked.
Example
Section titled “Example”{ "extras": { "client::notification": { "click": {"url": "https://notifly.net"} } }}Support
Section titled “Support”| Client | since | description |
|---|---|---|
| Notifly Android | v2.0.10 | Prevents opening the Notifly app by default |
bigImageUrl
Section titled “bigImageUrl”bigImageUrl (string): shows a large image in the notification.
Example
Section titled “Example”{ "extras": { "client::notification": { "bigImageUrl": "https://placekitten.com/400/300" } }}Support
Section titled “Support”| Client | since | description |
|---|---|---|
| Notifly Android | v2.3.0 | May require expanding the notification. |
android::action
Section titled “android::action”onReceive.intentUrl
Section titled “onReceive.intentUrl”onReceive.intentUrl (string): opens an intent after the notification is delivered.
Example
Section titled “Example”{ "extras": { "android::action": { "onReceive": {"intentUrl": "https://notifly.net"} } }}Support
Section titled “Support”| Client | since | description |
|---|---|---|
| Notifly Android | v2.0.11 | You must enable “Intent Action Permission” in the app settings, otherwise this feature only works when the app is active. |