From 53b085e7cea4a93604b71113e8c25400f7c06975 Mon Sep 17 00:00:00 2001 From: lead2gold Date: Sun, 14 Oct 2018 20:35:13 -0400 Subject: [PATCH] Updated Development_API (markdown) --- Development_API.md | 55 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/Development_API.md b/Development_API.md index 0bd2ac2..dd113aa 100644 --- a/Development_API.md +++ b/Development_API.md @@ -73,6 +73,61 @@ If you ever want to reset the object, you can use the **clear()** function. apobj.clear() ``` +Developers who wish to be able to generate information based on this library dynamically can use the __details()__ function: +```python +# returns an object containing details about the plugin for dynamic integration. +apobj.details() +``` +The output will look like: +```json +{ + "version": "0.5.2", + "asset": { + "default_extension": ".png", + "app_desc": "Apprise Notifications", + "image_path_mask": "https://github.com/caronc/apprise/raw/master/apprise/assets/themes/{THEME}/apprise-{TYPE}-{XY}{EXTENSION}", + "app_id": "Apprise", + "theme": "default", + "image_url_logo": "https://github.com/caronc/apprise/raw/master/apprise/assets/themes/{THEME}/apprise-logo.png", + "image_url_mask": "https://github.com/caronc/apprise/raw/master/apprise/assets/themes/{THEME}/apprise-{TYPE}-{XY}{EXTENSION}" + }, + "schemas": [ + { + "service_name": "Boxcar", + "setup_url": "https://github.com/caronc/apprise/wiki/Notify_boxcar", + "service_url": "https://boxcar.io/", + "protocols": null, + "secure_protocols": [ + "boxcar" + ] + }, + { + "service_name": "Discord", + "setup_url": "https://github.com/caronc/apprise/wiki/Notify_discored", + "service_url": "https://discordapp.com/", + "protocols": null, + "secure_protocols": [ + "discord" + ] + }, + { + "service_name": "E-Mail", + "setup_url": "https://github.com/caronc/apprise/wiki/Notify_email", + "service_url": null, + "protocols": [ + "mailto" + ], + "secure_protocols": [ + "mailtos" + ] + }, + + "... etc, ..." + + ] +} +``` +The idea behind the __details()__ function is that it allows developers to pass details back through their program letting their users know what notifications are supported. Thus as this library deprecates and introduces new notification services, calling front end applications (built around the __details()__ function) can automatically serve this information back to their user base. ## The Apprise Asset Object The apprise object allows you to customize your alarms by offering it different images, different sources and different themes. Different notification services support different ways of passing images into it (and some don't support images at all). Apprise offers a way of supporting both local and hosted images and looks after passing the correct one to the correct service (when requested).