From 544d1897ae1d44b8d27ba73b1791398fdfa90672 Mon Sep 17 00:00:00 2001 From: Holkinator Date: Thu, 29 Aug 2024 14:05:30 +0200 Subject: [PATCH] Update README.md --- README.md | 59 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 8f169e7..90a8aa9 100644 --- a/README.md +++ b/README.md @@ -43,47 +43,54 @@ This can be changed in the ``config.ini`` file ## Create a Notification > ### Example using [curl](https://curl.se/) > ```` -> curl '127.0.0.1:5000' \ +> curl '127.0.0.1:3000' \ > --header 'Content-Type: application/json' \ > --data '{ > "title": "Foo Bar Baz!", -> "body": "Lorem ipsum dolor sit amet, consectetur adipiscing elit." +> "message": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", +> "url": "http://example.com", > }' > ```` +>|Property|Type|Description|Required| +>|---|---|---|---| +>|title|String|The title of the notification|**Yes**| +>|message|String|The longer text that will be included in the notification|No| +>|url|String|Open the URL on notifcation press|No| +> +> #### Response +> `Created 201` + +## Get All Notifications +> +> ```` +> curl '127.0.0.1:3000' +> ```` > #### Response > ```` ->{ -> "status": 201, -> "message": "Successfully created notification", -> "data": { -> "title": "Foo Bar Baz!", -> "body": "Lorem ipsum dolor sit amet, consectetur adipiscing elit." -> } ->} +>[ +> { +> "title": "Foo Bar Baz!", +> "message": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", +> "url": "http://example.com", +> }, +> ... +>] > ```` -## Poll the Latest Notification + +## Get Latest Notifications > > ```` -> curl '127.0.0.1:5000' +> curl '127.0.0.1:3000/latest' > ```` > #### Response > ```` ->{ -> "status": 200, -> "message": "Polled last notification", -> "data": { -> "title": "Foo Bar Baz!", -> "body": "Lorem ipsum dolor sit amet, consectetur adipiscing elit." -> } ->} +> { +> "title": "Foo Bar Baz!", +> "message": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", +> "url": "http://example.com", +> } > ```` -## Roadmap - -- App Logging -- Instant Notifications - - ## Issues Please report issues using [GitHub's issues tab](https://github.com/viktorholk/push-notifications-api/issues).