From 50bd4b3fb5ca0dcf6e4c0c57daec349f7814ca88 Mon Sep 17 00:00:00 2001 From: Chris Caron Date: Fri, 29 Nov 2019 12:30:38 -0500 Subject: [PATCH] Better Micro-Service Integration Docs in README --- README.md | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 94ce6ec..3fb38ca 100644 --- a/README.md +++ b/README.md @@ -91,16 +91,6 @@ flake8 apprise_api pytest apprise_api ``` -## Micro-Service Integration - -Perhaps you run your own service and the only goal you have is to add notification support to it. Here is an example: -```bash -# Send your notifications -curl -X POST -d '{"urls": "mailto://user:pass@gmail.com", "body":"test message"}' \ - -H "Content-Type: application/json" \ - http://localhost:8000/notify -``` - ## Apprise Integration ### Apprise CLI Pull Example @@ -133,3 +123,20 @@ a.add(config) # Send a test message a.notify('test message') ``` + +## Micro-Service Integration +You can trigger the API to notify your pre-created keys like so: (using `/notify/{key}`): +```bash +# Send notification(s) to a {key} defined as 'my-apprise-key' +curl -X POST -d '{"body":"test message"}' \ + -H "Content-Type: application/json" \ + http://localhost:8000/notify/my-apprise-key +``` + +Here is a *stateless* example where no key is required (using `/notify/`): +```bash +# Send your notifications directly +curl -X POST -d '{"urls": "mailto://user:pass@gmail.com", "body":"test message"}' \ + -H "Content-Type: application/json" \ + http://localhost:8000/notify +```