[GH-ISSUE #755] Enable "Webhook GET-style" publishing via POST requests (with Jsonpath support) #544

Closed
opened 2026-05-07 00:25:17 +02:00 by BreizhHardware · 2 comments

Originally created by @Fabian-G on GitHub (May 29, 2023).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/755

💡 Idea
I'm thinking of using webhooks on webex (https://developer.webex.com/docs/api/v1/webhooks/create-a-webhook) to send push messages via ntfy to my phone when there are new messages, which works fine. However, the request send by webex looks something like this (some information stripped):

POST https://ntfy.sh/webex
{
  "id": "<id>",
  "name": "Messages",
  "targetUrl": "ntfy.sh/webex",
  "resource": "messages",
  "event": "created",
  "orgId": "<id>",
  "createdBy": "<id>",
  "appId": "<id>",
  "ownedBy": "creator",
  "status": "active",
  "created": "2023-05-28T19:22:14.720Z",
  "actorId": "<id>",
  "data": {
    "id": "<id>",
    "roomId": "<id>",
    "roomType": "group",
    "personId": "<id>",
    "personEmail": "<email>",
    "created": "2023-05-28T19:22:58.361Z"
  }
}

Therefore (as expected) the notification message is the json body, which doesn't look nice. Since the only real option to modify that request that webex offers is the targetUrl, I thought it would be nice to have the same options mentioned here, but for POST requests and therefore just ignore the body when the ?message="..." parameter is present.

What would be even nicer, is an option to use string interpolation on the parameters, reading values from the body via jsonpath.
For example: If I were to configure the targetUrl in webex as

https://ntfy.sh/webex?message="New message from {{$.data.personEmail}}"

Ntfy would parse the json body and set the message of the notification to "New message from <email>".

💻 Target components

  • ntfy server
Originally created by @Fabian-G on GitHub (May 29, 2023). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/755 <!-- Before you submit, consider asking on Discord/Matrix instead. You'll usually get an answer sooner, and there are more people there to help! - Discord: https://discord.gg/cT7ECsZj9w - Matrix: https://matrix.to/#/#ntfy:matrix.org / https://matrix.to/#/#ntfy-space:matrix.org --> :bulb: **Idea** I'm thinking of using webhooks on webex (https://developer.webex.com/docs/api/v1/webhooks/create-a-webhook) to send push messages via ntfy to my phone when there are new messages, which works fine. However, the request send by webex looks something like this (some information stripped): ``` POST https://ntfy.sh/webex ``` ```json { "id": "<id>", "name": "Messages", "targetUrl": "ntfy.sh/webex", "resource": "messages", "event": "created", "orgId": "<id>", "createdBy": "<id>", "appId": "<id>", "ownedBy": "creator", "status": "active", "created": "2023-05-28T19:22:14.720Z", "actorId": "<id>", "data": { "id": "<id>", "roomId": "<id>", "roomType": "group", "personId": "<id>", "personEmail": "<email>", "created": "2023-05-28T19:22:58.361Z" } } ``` Therefore (as expected) the notification message is the json body, which doesn't look nice. Since the only real option to modify that request that webex offers is the `targetUrl`, I thought it would be nice to have the same options mentioned [here](https://docs.ntfy.sh/publish/#webhooks-publish-via-get), but for POST requests and therefore just ignore the body when the `?message="..."` parameter is present. What would be even nicer, is an option to use string interpolation on the parameters, reading values from the body via jsonpath. For example: If I were to configure the `targetUrl` in webex as ``` https://ntfy.sh/webex?message="New message from {{$.data.personEmail}}" ``` Ntfy would parse the json body and set the `message` of the notification to "New message from \<email\>". <!-- Share your thoughts; try to be detailed if you can --> :computer: **Target components** <!-- Where should this feature/enhancement be added? --> <!-- e.g. ntfy server, Android app, iOS app, web app --> - ntfy server
BreizhHardware 2026-05-07 00:25:17 +02:00
Author
Owner

@wunter8 commented on GitHub (May 29, 2023):

There has been discussion about custom mappings of JSON fields to ntfy's notification fields (e.g., message, title, etc.)

Nothing has been implemented yet, but you can see some of the discussion here: https://github.com/binwiederhier/ntfy/issues/724

<!-- gh-comment-id:1567362964 --> @wunter8 commented on GitHub (May 29, 2023): There has been discussion about custom mappings of JSON fields to ntfy's notification fields (e.g., `message`, `title`, etc.) Nothing has been implemented yet, but you can see some of the discussion here: https://github.com/binwiederhier/ntfy/issues/724
Author
Owner

@binwiederhier commented on GitHub (May 30, 2023):

This is indeed a dup. I do like this templating approach too. I actually did implement this a year ago I think: #171 + #104

Closing as a dup in favor of #724

<!-- gh-comment-id:1567679939 --> @binwiederhier commented on GitHub (May 30, 2023): This is indeed a dup. I do like this templating approach too. I actually did implement this a year ago I think: #171 + #104 Closing as a dup in favor of #724
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#544
No description provided.