Back

Pushover API Essential Guide

Aug 14, 20246 minute read

What type of API does Pushover provide?

Pushover uses a REST API for its messaging service. Here are the key points:

API Type

Pushover uses a simple, versioned REST API to receive messages and broadcast them to devices running their client applications.

Key Characteristics

  • It's a REST API, which means it follows REST principles like using HTTP methods and representing resources.
  • The API is versioned, allowing for updates while maintaining backwards compatibility.
  • It's designed to be simple to use, without requiring complex authentication mechanisms like OAuth.

Implementation Details

  • Standard HTTP libraries in most programming languages can be used to interact with the API.
  • No custom modules or extra dependencies are needed.
  • The API can even be used from the command line.

Additional Features

  • Pushover also offers a Subscription API to simplify the process of collecting user keys when sending to multiple users.

In summary, Pushover uses a straightforward REST API that prioritizes simplicity and ease of use, making it accessible for developers across various platforms and programming languages.

Does the Pushover API have webhooks?

Pushover API

  1. Pushover uses a simple REST API for sending messages and broadcasting them to devices.

  2. The API does not require complex authentication mechanisms like OAuth. Standard HTTP libraries can be used to interact with the API.

  3. To use the API, you need to:

    • Register your application and get an API token
    • Send a POST request to https://api.pushover.net/1/messages.json with required parameters (token, user, message) and optional parameters.

Webhooks

  1. The official Pushover API does not appear to have native webhook support based on the provided search results.

  2. There is a feature request from a user asking Pushover to provide webhook receiver URLs bound to Pushover Channels. This suggests that webhook functionality is not currently available.

  3. The feature request proposes:

    • Creating webhook receiver URLs bound to Pushover Channels
    • Using JSON extractors to map received data to payload variables
    • Implementing usage limits and paid plans to control webhook usage

Alternative Approaches

  1. Some developers have created workarounds or third-party solutions to integrate Pushover with webhook-like functionality:

    • A Discourse plugin for Pushover notifications was mentioned, which allows sending notifications via Pushover.
    • Some users have created custom scripts to poll for notifications and send them to Pushover.
  2. These alternative approaches suggest that while Pushover doesn't natively support webhooks, it's possible to create integrations that achieve similar functionality using the existing API.

In conclusion, the official Pushover API does not appear to have built-in webhook support. However, the API does provide methods for sending notifications, which can be used in combination with custom scripts or third-party integrations to achieve webhook-like functionality.

Rate Limits and other limitations

Here are the key points about the API rate limits for the Pushover API:

Message Limits

  • Each application can send 10,000 messages per month for free [2][3]
  • One team-owned application can send up to 25,000 messages per month for free [2][3]
  • One message is defined as successfully sending a message to one user, regardless of how many devices that user has [2]
  • For delivery groups, each user in the group receiving the message counts as one message towards the quota [2]

Message Size Limits

  • Messages are limited to 1024 4-byte UTF-8 characters [3]
  • Message titles are limited to 250 characters [3]
  • Supplementary URLs are limited to 512 characters [3]
  • URL titles are limited to 100 characters [3]

Other Limitations

  • Attachments are limited to 2.5 MB (2,621,440 bytes) [3]
  • Message limits reset at 00:00:00 Central Time on the 1st of each month [3]
  • Once limits are reached, requests will be rejected with a 429 HTTP status code [3]

Best Practices

  • Implement basic rate limiting in your application [3]
  • Do not send more than 2 concurrent HTTP requests to the API [3]
  • Use HTTP keep-alive to speed up multiple requests [3]
  • Wait at least 5 seconds before retrying if you receive a 500 error [3]

Monitoring Usage

  • Usage statistics can be viewed on each application's page [3]
  • API calls return headers with current usage and limits [3]
  • A dedicated endpoint is available to check limits: https://api.pushover.net/1/apps/limits.json?token=YOUR_APP_TOKEN [3]

If higher message limits are needed, additional capacity can be purchased. For open source applications, there are special considerations for distributing API tokens.

Latest API Version

Based on the search results provided, here's the answer to your question:

Current Version of the Pushover API

The most recent version of the Pushover API is version 1. This can be inferred from the API endpoint URL provided in the search results:

https://api.pushover.net/1/messages.json

The "/1/" in the URL indicates that this is version 1 of the API.

Key Points to Consider

  1. The Pushover API uses a simple, versioned REST API for sending messages.

  2. The API doesn't require complicated authentication mechanisms like OAuth. Standard HTTP libraries in most programming languages can be used to interact with the API.

  3. As of version 3.0 of the Pushover apps (iOS, Android, and Desktop), the API supports image attachments with messages.

  4. The API supports various optional parameters such as priority, sound, URL, and more.

  5. While the core API version remains at 1, Pushover has introduced new features over time, such as encryption for notifications (since 2015) and support for custom sounds (as of April 2021).

Best Practices

  1. Always use HTTPS when making API requests to ensure security.

  2. When sending attachments, ensure they are within the 2.5 megabyte size limit.

  3. Use the appropriate sound parameter to customize notification tones for users.

  4. Consider using the Pushover for Teams service for organizations sending messages to multiple users.

  5. Stay updated with Pushover's blog for announcements about new features or changes to the service.

While the core API version hasn't changed, Pushover continues to evolve and add new features to its service. It's always a good idea to check their official documentation for the most up-to-date information on API usage and capabilities.

How to get a Pushover developer account and API Keys?

To get a developer account for Pushover and create an API integration, follow these steps:

1. Register an Application

  1. Go to the Pushover website (https://pushover.net) and log in to your account.

  2. Navigate to the "Your Applications" page (https://pushover.net/apps).

  3. Click on "Create an Application/API Token".

  4. Fill out the application registration form:

    • Set a name for your application
    • Upload an icon (optional)
    • Provide a description
    • Enter your website URL (optional)
  5. Agree to the terms of service and click "Create Application".

2. Obtain API Token

Once you've registered your application, you'll receive an API token. This token is a 30-character string containing letters and numbers.

Key Points to Consider

  • API tokens are free to register.
  • Each application or service using Pushover's API needs its own unique API token.
  • A single API token can be used to send notifications to multiple Pushover User Keys.
  • Keep your API token secure and don't share it with others or third-party services.

Best Practices

  1. Use HTTPS for all API calls.
  2. Enable TLS/SSL verification in your HTTP library for security.
  3. Use the POST method for API calls to push messages.
  4. Include required parameters (token, user, message) in your API requests.

Code Example

Here's a basic example of how to use your API token to send a message:

import requests url = "https://api.pushover.net/1/messages.json" data = { "token": "YOUR_API_TOKEN", "user": "USER_KEY", "message": "Hello from Pushover!" } response = requests.post(url, data=data) print(response.text)

Replace "YOUR_API_TOKEN" with the token you received after registering your application, and "USER_KEY" with the user key of the recipient.

What can you do with the Pushover API?

Based on the Pushover API documentation, here are the main data models you can interact with using the Pushover API:

Messages

  • Sending Messages:

    • You can send messages to users or groups with various parameters:
      • Required: token, user, message
      • Optional: device, title, url, url_title, priority, sound, timestamp, etc.
    • You can include HTML content in messages
    • You can set message priority (from -2 to 2)
    • You can set a custom sound for the notification
    • You can set a custom timestamp for the message
  • Attachments:

    • You can include one image attachment per message (up to 2.5MB)
    • Attachments can be sent as binary data or base64-encoded
  • Supplementary URLs:

    • You can include a supplementary URL with each message
    • The URL can have a custom title

Users and Devices

  • You can send messages to specific user devices
  • You can create and manage user groups
  • You can create subscriptions for sending to multiple users

Emergency Priority Messages

  • You can send emergency priority messages (priority 2)
  • These messages have special properties like 'acked' and 'receipt'

Open Client API

  • You can create custom clients to receive Pushover notifications
  • Clients can download and cache message data, including:
    • Message content, timestamp, sound, URL, priority, etc.

Licensing

  • You can manage desktop device licenses for Open Client API usage

Application Management

  • You can register and manage Pushover applications
  • Each application gets an API token for authentication

While not explicitly a data model, it's worth noting that the API also allows for:

  • Rate limiting and message size restrictions
  • Error handling and response parsing (JSON or XML)

This list covers the main data models and interactions possible with the Pushover API. Each of these areas has specific endpoints and parameters for interaction.