{"id":15525244,"url":"https://github.com/donatj/pushover-php","last_synced_at":"2025-04-23T08:47:41.431Z","repository":{"id":430675,"uuid":"8461839","full_name":"donatj/Pushover-PHP","owner":"donatj","description":"Simple Pushover API Wrapper for PHP","archived":false,"fork":false,"pushed_at":"2024-11-30T04:15:40.000Z","size":93,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T23:11:51.625Z","etag":null,"topics":["api-wrapper","pushover-api","pushover-php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/donatj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":"https://www.paypal.me/donatj/15","ko_fi":"donatj","github":"donatj"}},"created_at":"2013-02-27T17:58:46.000Z","updated_at":"2024-11-30T04:15:43.000Z","dependencies_parsed_at":"2023-10-02T04:32:29.053Z","dependency_job_id":"92fe2352-1c53-4bed-af63-fb68558f3b92","html_url":"https://github.com/donatj/Pushover-PHP","commit_stats":{"total_commits":49,"total_committers":4,"mean_commits":12.25,"dds":0.5510204081632653,"last_synced_commit":"490cb97e49afe42daec773a7c1929ffa27bbb688"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donatj%2FPushover-PHP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donatj%2FPushover-PHP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donatj%2FPushover-PHP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donatj%2FPushover-PHP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/donatj","download_url":"https://codeload.github.com/donatj/Pushover-PHP/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250402264,"owners_count":21424684,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-wrapper","pushover-api","pushover-php"],"created_at":"2024-10-02T10:55:57.054Z","updated_at":"2025-04-23T08:47:41.414Z","avatar_url":"https://github.com/donatj.png","language":"PHP","readme":"# Pushover PHP\n\n[![Latest Stable Version](https://poser.pugx.org/donatj/pushover/version)](https://packagist.org/packages/donatj/pushover)\n[![Total Downloads](https://poser.pugx.org/donatj/pushover/downloads)](https://packagist.org/packages/donatj/pushover)\n[![License](https://poser.pugx.org/donatj/pushover/license)](https://packagist.org/packages/donatj/pushover)\n[![ci.yml](https://github.com/donatj/Pushover-PHP/actions/workflows/ci.yml/badge.svg)](https://github.com/donatj/Pushover-PHP/actions/workflows/ci.yml)\n\n\nPushover PHP is a very light, simple API wrapper for the Pushover API written for PHP.\n\n\n## Requirements\n\n- **php**: \u003e=7.3\n- **ext-json**: *\n\n## Installing\n\nInstall the latest version with:\n\n```bash\ncomposer require 'donatj/pushover'\n```\n\n## Usage\n\n```php\n\u003c?php\n\nrequire __DIR__ . '/../vendor/autoload.php';\n\nuse donatj\\Pushover\\Exceptions\\ResponseException;\nuse donatj\\Pushover\\Options;\nuse donatj\\Pushover\\Priority;\nuse donatj\\Pushover\\Pushover;\nuse donatj\\Pushover\\Sounds;\n\n$po = new Pushover('{my_apikey}', '{my_userkey}');\n\ntry {\n\t// Simplest example\n\t$po-\u003esend('Hello World');\n\n\t// With Options:\n\t$po-\u003esend('Awesome website, great job!', [\n\t\tOptions::TITLE    =\u003e 'New Comment!',\n\t\tOptions::URL      =\u003e 'https://donatstudios.com/CsvToMarkdownTable',\n\t\tOptions::PRIORITY =\u003e Priority::HIGH,\n\t\tOptions::SOUND    =\u003e Sounds::ALIEN,\n\t]);\n}catch( ResponseException $e ) {\n\t// Handle exception\n}\n\n```\n\n## Documentation\n\nFor documentation about the protocol specifics, see the official [Pushover API Documentation](https://pushover.net/api).\n\nOn *success* `Pushover-\u003esend` returns a **truth-y** array like:\n\n```php\n[\n    'status'  =\u003e '1',\n    'request' =\u003e '2f4e9c7140df52d7d8b16ffb8adf1c2a',\n]\n```\n\nOn *failure* `Pushover-\u003esend` returns **false** which allows simple\n\n```php\nif( !$po-\u003esend('Hello World!') ) {\n\tdie('oh no!');\n}\n```\n\n\n### Class: \\donatj\\Pushover\\Exceptions\\ResponseException\n\n```php\n\u003c?php\nnamespace donatj\\Pushover\\Exceptions;\n\nclass ResponseException {\n\tpublic const ERROR_CONNECTION_FAILED = 100;\n\tpublic const ERROR_DECODE_FAILED = 200;\n\tpublic const ERROR_UNEXPECTED = 300;\n\tpublic const ERROR_API = 400;\n}\n```\n\n### Class: \\donatj\\Pushover\\Options\n\nContains available option keys for the Pushover API\n\n```php\n\u003c?php\nnamespace donatj\\Pushover;\n\nclass Options {\n\t/**\n\t * The Application API token.\n\t * \n\t * Defaults to the token \\donatj\\Pushover\\Pushover was constructed with.\n\t */\n\tpublic const TOKEN = 'token';\n\t/**\n\t * The User Key.\n\t * \n\t * Defaults to the user key \\donatj\\Pushover\\Pushover was constructed with.\n\t */\n\tpublic const USER = 'user';\n\t/** To enable HTML formatting, include HTML parameter set to 1. May not be used if monospace is used. */\n\tpublic const HTML = 'html';\n\t/** To enable Monospace formatting, include HTML parameter set to 1. May not be used if html is used. */\n\tpublic const MONOSPACE = 'monospace';\n\t/**\n\t * The optional devices name for the message to be pushed to.\n\t * \n\t * If unspecified, your message will be pushed to all devices.\n\t */\n\tpublic const DEVICE = 'device';\n\t/** The optional message title */\n\tpublic const TITLE = 'title';\n\t/** The optional message url */\n\tpublic const URL = 'url';\n\t/** The optional message url title. Must specify a URL as well. */\n\tpublic const URL_TITLE = 'url_title';\n\t/** The priority of the message being sent. */\n\tpublic const PRIORITY = 'priority';\n\t/** An optional UNIX timestamp for your message. Otherwise the current time is used. */\n\tpublic const TIMESTAMP = 'timestamp';\n\t/** The sound to play on receiving the pushover message. */\n\tpublic const SOUND = 'sound';\n\t/** A number of seconds that the message will live, before being deleted automatically */\n\tpublic const TTL = 'ttl';\n}\n```\n\n### Class: \\donatj\\Pushover\\Priority\n\nContains all legal values for 'priority'\n\n```php\n\u003c?php\nnamespace donatj\\Pushover;\n\nclass Priority {\n\tpublic const LOWEST = -2;\n\tpublic const LOW = -1;\n\tpublic const NORMAL = 0;\n\tpublic const HIGH = 1;\n\tpublic const EMERGENCY = 2;\n}\n```\n\n### Class: \\donatj\\Pushover\\Pushover\n\nDead Simple API Interface for Pushover Messages\n\n```php\n\u003c?php\nnamespace donatj\\Pushover;\n\nclass Pushover {\n\tpublic const API_URL = 'https://api.pushover.net/1/messages.json';\n}\n```\n\n#### Method: Pushover-\u003e__construct\n\n```php\nfunction __construct(string $token, string $user [, string $apiUrl = self::API_URL])\n```\n\nCreate a pushover object\n\n##### Parameters:\n\n- ***string*** `$token` - The application API token\n- ***string*** `$user` - Your user key\n- ***string*** `$apiUrl` - Optionally change the API URL\n\n---\n\n#### Method: Pushover-\u003esend\n\n```php\nfunction send(string $message [, array $options = []]) : array\n```\n\nSend the pushover message\n\n##### Parameters:\n\n- ***string*** `$message` - The message to send\n- ***array\u003cstring,mixed\u003e*** `$options` - Optional configuration settings\n\n**Throws**: `\\donatj\\Pushover\\Exceptions\\ResponseException` - On failure to connect or decode the response\n\n##### Returns:\n\n- ***array*** - The decoded JSON response as an associative array\n\n### Class: \\donatj\\Pushover\\Sounds\n\nContains legal values for 'sound'\n\n```php\n\u003c?php\nnamespace donatj\\Pushover;\n\nclass Sounds {\n\t/** Pushover (default) */\n\tpublic const PUSHOVER = 'pushover';\n\t/** Bike */\n\tpublic const BIKE = 'bike';\n\t/** Bugle */\n\tpublic const BUGLE = 'bugle';\n\t/** Cash Register */\n\tpublic const CASH_REGISTER = 'cashregister';\n\t/** Classical */\n\tpublic const CLASSICAL = 'classical';\n\t/** Cosmic */\n\tpublic const COSMIC = 'cosmic';\n\t/** Falling */\n\tpublic const FALLING = 'falling';\n\t/** Gamelan */\n\tpublic const GAMELAN = 'gamelan';\n\t/** Incoming */\n\tpublic const INCOMING = 'incoming';\n\t/** Intermission */\n\tpublic const INTERMISSION = 'intermission';\n\t/** Magic */\n\tpublic const MAGIC = 'magic';\n\t/** Mechanical */\n\tpublic const MECHANICAL = 'mechanical';\n\t/** Piano Bar */\n\tpublic const PIANO_BAR = 'pianobar';\n\t/** Siren */\n\tpublic const SIREN = 'siren';\n\t/** Space Alarm */\n\tpublic const SPACE_ALARM = 'spacealarm';\n\t/** Tug Boat */\n\tpublic const TUGBOAT = 'tugboat';\n\t/** Alien Alarm (long) */\n\tpublic const ALIEN = 'alien';\n\t/** Climb (long) */\n\tpublic const CLIMB = 'climb';\n\t/** Persistent (long) */\n\tpublic const PERSISTENT = 'persistent';\n\t/** Pushover Echo (long) */\n\tpublic const PUSHOVER_ECHO = 'echo';\n\t/** Up Down (long) */\n\tpublic const UP_DOWN = 'updown';\n\t/** Vibrate Only */\n\tpublic const VIBRATE = 'vibrate';\n\t/** None (silent) */\n\tpublic const NONE = 'none';\n}\n```","funding_links":["https://www.paypal.me/donatj/15","https://ko-fi.com/donatj","https://github.com/sponsors/donatj"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdonatj%2Fpushover-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdonatj%2Fpushover-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdonatj%2Fpushover-php/lists"}