Skip to content

ridercz/Pushover-API

Repository files navigation

NuGet Status

Pushover API Client

Pushover is simple notification service and mobile device application. For sending notifications (messages) if offers a web API.

The API is quite weird combination of REST-like approach and old-school HTTP POST form emulation and I was not able to find any .NET client that would seem to be maintained and actually working.

So, I wrote one, with fairly modern approach.

Getting started

First, install the NuGet package Altairis.Pushover.Client:

Install-Package Altairis.Pushover.Client

Then create instance of the PushoverClient class:

// Create client class with API token obtained from app registration
var client = new PushoverClient("axxxxxxxxxxxxxxxxxxxxxxxxxxxxx");

Then prepare the message using PushoverMessage. Recipient user ID and message text are required, various other options can be set as properties:

// Create a message with user ID obtained from recipient user registration
var message = new PushoverMessage("uxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "This is a test message") {
    Title = "Test message"
};

Then send message (asynchronously) and check if the call was successfull:

// Send message
var result = await client.SendMessage(message);

// Check for success
if (result.Status) {
    Console.WriteLine("Message sent successfully!");
} else {
    Console.WriteLine("Message send failed!");
}

Documentation

API reference documentation can be found in wiki.

Legal

About

C#/.NET client for Pushover service

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages