Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
viktorholk authored Aug 29, 2024
1 parent 3ea04e2 commit 544d189
Showing 1 changed file with 33 additions and 26 deletions.
59 changes: 33 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down

0 comments on commit 544d189

Please sign in to comment.