Skip to content

Commit

Permalink
feat: add PowerShell push message instructions
Browse files Browse the repository at this point in the history
Signed-off-by: eternal-flame-AD <[email protected]>
  • Loading branch information
eternal-flame-AD committed Jul 29, 2024
1 parent 74089fd commit ec2fb09
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docs/pushmsg.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,20 @@ An application can be added via
To authenticate as an application you need the application token.
The token is returned in the REST request and is viewable in the WebUI.

Now you can simply use [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/) or any other http-client to push messages.
Now you can simply use [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/) or any other installed http-client to push messages.

```bash
$ curl "https://push.example.de/message?token=<apptoken>" -F "title=my title" -F "message=my message" -F "priority=5"
$ http -f POST "https://push.example.de/message?token=<apptoken>" title="my title" message="my message" priority="5"
```

On Microsoft PowerShell, you could alternatively use the built-in `Invoke-RestMethod` or `Invoke-WebRequest` cmdlets.

```powershell
PS> Invoke-RestMethod -Uri "https://push.example.de/message?token=<apptoken>" -Method POST -Body @{title="my title"; message="my message"; priority=5} # return is automatically parsed into a PowerShell object
PS> Invoke-WebRequest -Uri "https://push.example.de/message?token=<apptoken>" -Method POST -Body @{title="my title"; message="my message"; priority=5} # return is as raw response
```

> The message API takes an `extras` property that carries extra information with the message and describes how clients behave to this message.
> See [message extras](msgextras.md) for more information.
Expand Down

0 comments on commit ec2fb09

Please sign in to comment.