Updated Development_API (markdown)

Chris Caron 2019-02-15 15:20:16 -05:00
parent bde8dece72
commit faf4ccd843

@ -70,7 +70,7 @@ apobj.notify(
)
```
#### Leverage Tagging
If you associated tags with your notification services (when you called **add()** earlier, you can leverage it's full potential through the **notify()** function here. Tagging however allows you to trigger notifications only when a criteria is met. The tagging logic can be interpreted as follows:
If you associated tags with your notification services when you called **add()** earlier, you can leverage it's full potential through the **notify()** function here. Tagging however allows you to trigger notifications only when a criteria is met. The tagging logic can be interpreted as follows:
| apprise.notify(tag=**match**) | Tag Representation |
| -------------------------------- | ------------------------ |
@ -84,23 +84,27 @@ If you associated tags with your notification services (when you called **add()*
Now that we've added our services and assigned them tags, this is how we can access them:
```python
# Has TagA
apobj.notify(title='a title', body="a body", tag="tagA")
apobj.notify(
title='a title', body="a body", tag="tagA")
# Has TagA OR TagB
apobj.notify(title='a title', body="a body", tag=["tagA", "TagB"])
apobj.notify(
title='a title', body="a body", tag=["tagA", "TagB"])
# Has TagA AND TagB
apobj.notify(title='a title', body="a body", tag=[("tagA", "TagB")])
apobj.notify(
title='a title', body="a body", tag=[("tagA", "TagB")])
# Has TagA OR TagB OR (TagC AND TagD)
apobj.notify(title='a title', body="a body", tag=["tagA", "TagB", ["TagC", "TagD"]])
apobj.notify(
title='a title', body="a body", tag=["tagA", "TagB", ["TagC", "TagD"]])
# No reference to tags; alert all of the added services
apobj.notify(title="my title", body="my body")
```
#### Tagging and Categories
Another use case for tagging might be for a system owner to fill their code with clean logic like:
Another use case for tagging might be to instead interpret them as categories. A system owner could simply fill their code with clean logic like:
```python
#... stuff happening
apobj.notify(title='a title', body="a body", tag="service-message")