From c31b9236a1d10b413980934f6b0159e743fc5a93 Mon Sep 17 00:00:00 2001 From: Philipp Born Date: Wed, 22 Feb 2023 21:14:14 +0100 Subject: [PATCH] docs: add traccar example --- docs/examples.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/examples.md b/docs/examples.md index 0c892e6..5979637 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -572,4 +572,27 @@ Example `template.html`: Add notification on Rundeck (attachment type must be: `Attached as file to email`): ![Rundeck](static/img/rundeck.png) +## Traccar +This will only work on selfhosted [traccar](https://www.traccar.org/) ([Github](https://github.com/traccar/traccar)) instances, as you need to be able to set `sms.http.*` keys, which is not possible through the UI attributes +The easiest way to integrate traccar with ntfy, is to configure ntfy as the SMS provider for your instance. You then can set your ntfy topic as your account's phone number in traccar. Sending the email notifications to ntfy will not work, as ntfy does not support HTML emails. + +**Caution:** JSON publishing is only possible, when POST-ing to the root URL of the ntfy instance. (see [documentation](publish.md#publish-as-json)) +```xml + https://ntfy.sh + + { + "topic": "{phone}", + "message": "{message}" + } + +``` +If [access control](config.md#access-control) is enabled, and the target topic does not support anonymous writes, you'll also have to provide an authorization header, for example in form of a privileged token +```xml + Bearer tk_JhbsnoMrgy2FcfHeofv97Pi5uXaZZ +``` +or by simply providing traccar with a valid username/password combination. +```xml + phil + mypass +```