mirror of https://github.com/caronc/apprise
Updated Development_Apprise_Details (markdown)
parent
207ee41b06
commit
064aca7257
|
@ -1,6 +1,19 @@
|
|||
# Apprise details() Enhancement
|
||||
# Apprise details()
|
||||
```python
|
||||
{
|
||||
"version": "X.Y.Z",
|
||||
"asset": { ... },
|
||||
"schemas": [ ... ],
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
**Apprise().details()** now returns a significant more amount of information about each notification allowing developers to dynamically build the URLs used by Apprise by knowing (in advance) all of the arguments needed to do so.
|
||||
A call to the **Apprise().details()** object returns a list of supported notification services available. It's syntax can be broken down into 3 major categories:
|
||||
* **Version**: A string representation of the current version of the Apprise library.
|
||||
* **asset**: Some developers will provide their own [[Apprise Asset Object|Development_API#the-apprise-asset-object]] tailored to their own system. This is merely a view into the current loaded configuration.
|
||||
* **schemas**: This is a identifying all of the supported notification services and a very high level point of reference to them such as their official documentation, the apprise documentation, and the name of the service itself.
|
||||
|
||||
A simple way to look at all of the data available to you can be done like so:
|
||||
```python
|
||||
import apprise
|
||||
from json import dumps
|
||||
|
@ -14,7 +27,72 @@ a = apprise.Apprise()
|
|||
print(dumps(a.details(), indent=2)
|
||||
```
|
||||
|
||||
It does this by introducing four (4) new sections in the _details_ section of the JSON output:
|
||||
## Version
|
||||
This is just a simple string that you can use as a reference to help identify what version of Apprise is loaded. The version identified here can have a direct impact on what notification services have been made available to you and additions to this very API.
|
||||
|
||||
## Asset
|
||||
[[The Apprise Asset Object|Development_API#the-apprise-asset-object]] during the initialization of Apprise can be altered to conform to different products. The Asset object really just defines some static globals that are referenced through-out the entire life of the Apprise object itself.
|
||||
|
||||
This section of the JSON response simply allows one to review what was set/specified. By default, the output might look like this:
|
||||
```python
|
||||
"asset": {
|
||||
"app_id": "Apprise",
|
||||
"app_desc": "Apprise Notifications",
|
||||
|
||||
"theme": "default",
|
||||
"default_extension": ".png",
|
||||
|
||||
"image_path_mask": "https://github.com/caronc/apprise/raw/master/apprise/assets/themes/{THEME}/apprise-{TYPE}-{XY}{EXTENSION}",
|
||||
"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
|
||||
Here is where all of the supported notification services are identified and all of the details you need to know about in order to use one.
|
||||
|
||||
Below is an example of what the output would look like:
|
||||
```python
|
||||
"schemas": {
|
||||
"service_name": "Boxcar",
|
||||
"service_url": "https://boxcar.io/",
|
||||
|
||||
"setup_url": "https://github.com/caronc/apprise/wiki/Notify_boxcar",
|
||||
"protocols": null,
|
||||
"secure_protocols": [
|
||||
"boxcar"
|
||||
],
|
||||
# Details are discussed a bit lower since there is a lot of information
|
||||
# here.
|
||||
"details": {...}
|
||||
},
|
||||
{
|
||||
"service_name": "Discord",
|
||||
"service_url": "https://discordapp.com/",
|
||||
|
||||
"setup_url": "https://github.com/caronc/apprise/wiki/Notify_discored",
|
||||
"protocols": null,
|
||||
"secure_protocols": [
|
||||
"discord"
|
||||
],
|
||||
# Details are discussed a bit lower since there is a lot of information
|
||||
# here.
|
||||
"details": {...}
|
||||
},
|
||||
```
|
||||
* `service_name` gives you a general description of the notification service itself.
|
||||
* `service_url` provides information to the official source of the notification service.
|
||||
* `setup_url` provides the URL you can reference to see examples on how to construct your Apprise URL.
|
||||
* `protocols` identifies the accepted schema for non-encrypted references to the service. It is not uncommon to have this field set to `null` simply stating that there simply isn't a non-encrypted form of using this service.
|
||||
* `secure_protocols` identifies the accepted schema for encrypted references to the service.
|
||||
* `details` goes into a much more granular view of the protocol. This is covered in the next section.
|
||||
|
||||
All services will have _AT LEAST_ one protocol/schema you can use to access it by.
|
||||
|
||||
### Details
|
||||
This identifies a much more granular view of the schema object itself. There is enough details in here on every single supported notification service that an end user could ask for simple to read arguments like `token`, `password`, `target_users` and dynamically construct the URL on their own. You can also just feed these tokens into the [[Apprise Notification Object|Development_API#the-apprise-notification-object]] directly for those using this product at a very low level.
|
||||
|
||||
This section was the newest addition to what is provided. There are 4 core sections within the `details` part of the of the JSON output:
|
||||
|
||||
1. **templates**: Identifies the URL structure associated with the specific service, eg:
|
||||
```json
|
||||
|
|
Loading…
Reference in New Issue