JPushover11/README.md
Michael Fogh Kristensen 1a1f230e4d
Update README.md
Typo fixed
2020-01-09 10:00:38 +01:00

1.6 KiB

Maven Central

JPushover

A zero-dependency convenient class for sending messages to Pushover in Java.

Requires Java 11.

Support Messages API and Glances API.

Usage

  1. Add the jpushover dependency to your pom.xml:
<dependency>
    <groupId>de.svenkubiak</groupId>
    <artifactId>jpushover</artifactId>
    <version>x.x.x</version>
</dependency>
  1. Use the JPushover object with the required informations were you want
JPushover.newMessage()
	.withToken("MyToken")
	.withUser("MyUser")
	.withMessage("MyMessage")
	.push();

JPushover.newGlance()
	.withToken("MyToken")
	.withUser("MyUser")
	.withText("MyText")
	.push();		

When using the Message API you can additionally add available options from the official Pushover documentation

You can also validate a user and token using the following method

boolean valid = JPushover.newMessage()
	.withToken("MyToken")
	.withUser("MyUser")
	.validate();

If you want more information and/or the response from the Pushover API, use the PushoverResponse object.

PushoverResponse PushoverResponse = JPushover.newMessage()
	.withToken("MyToken")
	.withUser("MyUser")
	.withMessage("MyMessage")
	.push();

The PushoverResponse will return the raw HTTP status code, along with the raw JSON response and a convenient boolean if the request was successful or not.