Ntfy Notifications
Ce contenu n’est pas encore disponible dans votre langue.
Account Setup
Section titled “Account Setup”Ntfy is a easy to use messaging service.
Syntax
Section titled “Syntax”Ntfy can send notifications through the following modes:
- private: A locally hosted private server (github source)
- cloud: A setup pointing to https://ntfy.sh
Valid syntax is as follows:
ntfy://{topic}ntfy://{host}/{topic}ntfy://{host}:{port}/{topics}ntfy://{user}@{host}/{topics}ntfy://{user}@{host}:{port}/{topics}ntfy://{user}:{password}@{host}/{topics}ntfy://{user}:{password}@{host}:{port}/{topics}ntfy://{token}@{hostname}/{topics}
The secure versions:
ntfys://{topic}ntfys://{host}/{topic}ntfys://{host}:{port}/{topics}ntfys://{user}@{host}/{topics}ntfys://{user}@{host}:{port}/{topics}ntfys://{user}:{password}@{host}/{topics}ntfys://{user}:{password}@{host}:{port}/{topics}ntfys://{token}@{hostname}/{topics}
You can specify more then 1 topic such as:
- ntfy://{user}:{password}/{hostname}/{topic1}/{topic2}
Parameter Breakdown
Section titled “Parameter Breakdown”| Variable | Required | Description |
|---|---|---|
| user | *No | The user account to perform the authentication with |
| password | *No | The password to perform the authentication with |
| hostname | *No | The ntfy server you’re sending your notification to. |
| port | No | The port the ntfy server is listening on. By default the port is 80 for ntfy:// and 443 for all ntfys:// references. |
| topic | Yes | All notifications to a ntfy server MUST have at least one topic defined. |
| token | No | This is detected, but can otherwise be explicitly specified as a parameter. |
| mode | No | The authentication mode is automatically detected based what it parses from the URL provided. You only need to set this if you feel it is being detected incorrectly. The possible modes are private and cloud and are explained above. |
| auth | No | Can be set to either basic (default) or token . basic is for User/Password authentication with the Ntfy server while token assumes that the provided credentials was a Authorization Token and authenticates in a different fashion. |
| No | An email to associate the ntfy post with. | |
| tags | No | The ntfy tags to associate with the ntfy post. Use a comma and/or space to specify more then one. |
| attach | No | Specify a web URL pointing at a remote attachment you would like the post to reference. |
| filename | No | This is only used if the attach was also provided. The ntfy server is smart enough to determine what the filename is automatically from this; however if you wish to provide a custom-override to this value, this is where you do it from. |
| click | No | Provide a hyperlink that you want users who receive your notification to advance to if they click on it. |
| priority | No | Provide a priority such as max, high, default, low, or min. By default default is used if one isn’t otherwise provided. |
| actions | No | ntfy action buttons variable |
| delay | No | Identify a delay for the message reception |
| image | No | This defaults to ‘Yes’ and hauls in the image associated with the notification |
| avatar_url | No | Optionally over-ride the Apprise Icon notifications and explicitly identify your own |
Examples
Section titled “Examples”Send a ntfy notification to our server
# Assuming our {hostname} is localhost# Assuming our {topic} is great-placeapprise -vv -t "Test Message Title" -b "Test Message Body" \ ntfy://localhost/great-placeWe can also send a notification to the ntfy.sh server:
# Assuming our {topic} is great-placeapprise -vv -t "Test Message Title" -b "Test Message Body" \ ntfy://great-placeNtfy also supports Markdown; if you want to leverage this, simply add ?format=markdown to your Apprise URL; eg:
# Assuming our {hostname} is localhost# Assuming our {topic} is great-place# Assuming we want to leverage the markdown supportapprise -vv -t "Test Message Title" -b "# Markdown Support" \ "ntfy://localhost/great-place?format=markdown"If your Ntfy server is behind an HTTPS (Secure) hosted setup, then you simply use ntfys://:
Global Parameters
Section titled “Global Parameters”| Variable | Description |
|---|---|
| overflow | This parameter can be set to either split, truncate, or upstream. This determines how Apprise delivers the message you pass it. By default this is set to upstream 👉 upstream: Do nothing at all; pass the message exactly as you received it to the service.👉 truncate: Ensure that the message will fit within the service’s documented upstream message limit. If more information was passed then the defined limit, the overhead information is truncated.👉 split: similar to truncate except if the message doesn’t fit within the service’s documented upstream message limit, it is split into smaller chunks and they are all delivered sequentially there-after. |
| format | This parameter can be set to either text, html, or markdown. Some services support the ability to post content by several different means. The default of this varies (it can be one of the 3 mentioned at any time depending on which service you choose). You can optionally force this setting to stray from the defaults if you wish. If the service doesn’t support different types of transmission formats, then this field is ignored. |
| verify | External requests made to secure locations (such as through the use of https) will have certificates associated with them. By default, Apprise will verify that these certificates are valid; if they are not then no notification will be sent to the source. In some occasions, a user might not have a certificate authority to verify the key against or they trust the source; in this case you will want to set this flag to no. By default it is set to yes. |
| cto | This stands for Socket Connect Timeout. This is the number of seconds Requests will wait for your client to establish a connection to a remote machine (corresponding to the connect()) call on the socket. The default value is 4.0 seconds. |
| rto | This stands for Socket Read Timeout. This is the number of seconds the client will wait for the server to send a response. The default value is 4.0 seconds. |
| emojis | Enable Emoji support (such as providing :+1: would translate to 👍). By default this is set to no. Note: Depending on server side settings, the administrator has the power to disable emoji support at a global level; but default this is not the case. |
| tz | Identify the IANA Time Zone Database you wish to operate as. By default this is detected based on the configuration the server hosting Apprise is running on. You can set this to things like America/Toronto, or any other properly formated Timezone describing your area. |
# Assuming our SECURE {hostname} is localhost# Assuming our {topic} is great-topicapprise -vv -t "Test Secure Message Title" -b "Test Message Body" \ ntfys://localhost/great-topicSends a ntfy message leveraging the action=
apprise -vv -t "Title" -b "Message content" \ ntfy://ntfy.selfhostedexample.com/mytopic?actions=view%2CGoogle%2Chttps://www.google.com%3Bview%2CBing%2Chttps://www.bing.com