From 30d87c82848f5d3534797565e74a1edae1a6d79e Mon Sep 17 00:00:00 2001 From: Chris Caron Date: Sun, 26 Feb 2023 10:33:14 -0500 Subject: [PATCH] Added a Apprise URL Details Endpoint (/details) (#105) --- README.md | 1 + apprise_api/api/templates/base.html | 2 + apprise_api/api/templates/details.html | 128 ++++++++++++++++ apprise_api/api/tests/test_details.py | 78 ++++++++++ apprise_api/api/urls.py | 3 + apprise_api/api/utils.py | 60 ++++++++ apprise_api/api/views.py | 204 +++++++++++-------------- apprise_api/core/settings/__init__.py | 3 + apprise_api/static/css/base.css | 7 + 9 files changed, 375 insertions(+), 111 deletions(-) create mode 100644 apprise_api/api/templates/details.html create mode 100644 apprise_api/api/tests/test_details.py diff --git a/README.md b/README.md index 799da77..e60627e 100644 --- a/README.md +++ b/README.md @@ -128,6 +128,7 @@ You can pre-save all of your Apprise configuration and/or set of Apprise URLs an | `/get/{KEY}` | POST | Returns the Apprise Configuration from the persistent store. This can be directly used with the *Apprise CLI* and/or the *AppriseConfig()* object ([see here for details](https://github.com/caronc/apprise/wiki/config)). | `/notify/{KEY}` | POST | Sends notification(s) to all of the end points you've previously configured associated with a *{KEY}*.
*Payload Parameters*
📌 **body**: Your message body. This is the *only* required field.
📌 **title**: Optionally define a title to go along with the *body*.
📌 **type**: Defines the message type you want to send as. The valid options are `info`, `success`, `warning`, and `failure`. If no *type* is specified then `info` is the default value used.
📌 **tag**: Optionally notify only those tagged accordingly.
📌 **format**: Optionally identify the text format of the data you're feeding Apprise. The valid options are `text`, `markdown`, `html`. The default value if nothing is specified is `text`. | `/json/urls/{KEY}` | GET | Returns a JSON response object that contains all of the URLS and Tags associated with the key specified. +| `/details` | GET | Set the `Accept` Header to `application/json` and retrieve a JSON response object that contains all of the supported Apprise URLs. See [here for more details](https://github.com/caronc/apprise/wiki/Development_Apprise_Details#apprise-details) As an example, the `/json/urls/{KEY}` response might return something like this: diff --git a/apprise_api/api/templates/base.html b/apprise_api/api/templates/base.html index a426d3a..77ed482 100644 --- a/apprise_api/api/templates/base.html +++ b/apprise_api/api/templates/base.html @@ -48,6 +48,8 @@ {% endif %}