API Endpoints
It’s possible to trigger notifications generation using the following endpoints:
Raw notifications
Generates notifications with the title/content provided in the request.
GET/POST/PUT https://hook.notify17.net/api/raw/{RAW_API_KEY}
Variable | Type | Notes |
---|---|---|
title | string, required | Notification title |
content | string | Notification content |
silent | bool (true/false ) | Mark this notification as silent |
sound | string | Sound to use for the notification (ignored if silent is true ) |
Supported content types:
- JSON:
application/json
,text/plain
- Form data:
application/x-www-form-urlencoded
,multipart/form-data
- YAML:
application/x-yaml
,application/yaml
,text/yaml
,text/x-yaml
Sample requests:
curl -X POST \
"https://hook.notify17.net/api/raw/RAW_API_KEY" \
-F title="Instance setup: finished" \
-F content="Instance ${HOSTNAME} has been set up correctly!"
-F sound="arcturus"
curl "https://hook.notify17.net/api/raw/RAW_API_KEY?title=Instance%20setup%20completed"
curl -v -X POST "https://hook.notify17.net/api/raw/RAW_API_KEY" \
-H 'Content-Type: application/yaml' \
--data-binary @- <<EOF
title: "Instance setup: finished"
content: "Instance ${HOSTNAME} has been set up correctly!"
EOF
Templated notifications
Generates a notification starting from a notification template.
GET/POST/PUT https://hook.notify17.net/api/template/{TEMPLATE_API_KEY}
Variable | Type | Notes |
---|---|---|
All body/query arguments | * | Template arguments |
All headers | * | Template arguments, accessible in the __n17Headers map |
Supported content types:
- JSON:
application/json
,text/plain
- Form data:
application/x-www-form-urlencoded
,multipart/form-data
- YAML:
application/x-yaml
,application/yaml
,text/yaml
,text/x-yaml
(accepts only YAML objects, not arrays)
Sample requests:
curl -X POST \
"https://hook.notify17.net/api/template/TEMPLATE_API_KEY" \
-F hostname="10.0.1.2"
curl "https://hook.notify17.net/api/template/TEMPLATE_API_KEY?hostname=10.0.1.2"
curl -v -X POST "https://hook.notify17.net/api/template/TEMPLATE_API_KEY" \
-H 'Content-Type: application/json' \
--data-binary @- <<EOF
{
"name": "Mr. Anderson",
"city": "Zion"
}
EOF
curl -v -X POST "https://hook.notify17.net/api/template/TEMPLATE_API_KEY" \
-H 'Content-Type: application/yaml' \
--data-binary @- <<EOF
name: Mr. Anderson
city: Zion
EOF
Raw templated notifications
Generates notifications starting from:
- A title/content templates pair provided with the request.
- The templates' arguments, composed by the rest of the request body.
GET/POST/PUT https://hook.notify17.net/api/rawTemplated/{RAW_API_KEY}
Variable | Type | Notes |
---|---|---|
__n17TitleTemplate | string, required | Notification title template |
__n17ContentTemplate | string | Notification content template |
__n17SoundTemplate | string | Template of the sound to use for the notification (ignored if __n17SilentCondition evaluates to true ) |
__n17TriggerCondition | string | Trigger condition for the template |
__n17SilentCondition | string | Silent condition for the template |
Every other body/query argument | * | Template arguments |
All headers | * | Template arguments, accessible in the __n17Headers map |
Supported content types:
- JSON:
application/json
,text/plain
- Form data:
application/x-www-form-urlencoded
,multipart/form-data
- YAML:
application/x-yaml
,application/yaml
,text/yaml
,text/x-yaml
Sample requests:
curl -X POST \
"https://hook.notify17.net/api/rawTemplated/RAW_API_KEY" \
-F __n17TitleTemplate="Instance setup: finished" \
-F __n17ContentTemplate="Instance {{ .hostname }} has been set up!" \
-F __n17SoundTemplate="{{ if .soundName }}{{ .soundName }}{{ else }}arcturus{{ end }}" \
-F hostname="10.0.1.2" \
-F sound="alya"