Closed caronc closed 4 months ago
Related issue (if applicable): refs #183
Added the ability to remap fields during a notification submission by using : (colon) in the GET args of the post.
:
For example, consider a situation where your server posts the following:
{ "content": "Message body", "subject": "Message title", }
These fields can be mapped to what the Apprise API expects with the following URL:
curl -X POST \ -F "body=Test Message" \ -F "tags=all" \ "http://localhost:8000/notify/apprise-api-key?:content=body&:subject=title"
The above identifies :content=body which tells the Apprise API to map the content entry to body, and :subject tells it to map subject to title. Effectively, your payload looks like this now which is exactly what Apprise needed! :rocket: :
:content=body
content
body
:subject
subject
title
{ "body": "Message body", "title": "Message title", }
The colon : prefix is the switch that starts the rule engine. You can do 3 possible things with the rule engine:
:existing_key=new_key
:existing_key=
:apprise_key=A value to give it
flake8
Description:
Related issue (if applicable): refs #183
Added the ability to remap fields during a notification submission by using
:
(colon) in the GET args of the post.For example, consider a situation where your server posts the following:
These fields can be mapped to what the Apprise API expects with the following URL:
The above identifies
:content=body
which tells the Apprise API to map thecontent
entry tobody
, and:subject
tells it to mapsubject
totitle
. Effectively, your payload looks like this now which is exactly what Apprise needed! :rocket: :The colon
:
prefix is the switch that starts the rule engine. You can do 3 possible things with the rule engine::existing_key=new_key
: Rename an existing key to one apprise wants:existing_key=
: By setting no value, the existing key is simply removed from the payload entirely:apprise_key=A value to give it
: You can also set an expected apprise key to a pre-generated string value.Checklist
flake8
)