Open
Conversation
This commit adds support for GatewayAPI SMS notifications with comprehensive test coverage. Features: - Send SMS notifications via GatewayAPI REST API - Support for multiple target phone numbers - Optional sender/from parameter for branding - Full URL parsing and reconstruction - Proper phone number validation Testing: - Comprehensive URL parsing tests - Edge case handling (invalid numbers, multiple targets) - HTTP response code handling (200, 201, 4xx, 5xx) - Request exception handling - Privacy URL masking 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1430 +/- ##
========================================
Coverage 99.65% 99.65%
========================================
Files 174 175 +1
Lines 22554 22654 +100
Branches 3587 3605 +18
========================================
+ Hits 22476 22576 +100
Misses 70 70
Partials 8 8
🚀 New features to boost your workflow:
|
caronc
reviewed
Oct 19, 2025
apprise/plugins/gatewayapi.py
Outdated
Comment on lines
+172
to
+175
| payload = { | ||
| "message": body, | ||
| "recipients.0.msisdn": int(target), | ||
| } |
Owner
There was a problem hiding this comment.
This is a great start! but when i visit https://gatewayapi.com/docs/apis/rest/#sending-sms-messages, it seems like the payload doesn't align. You're missing quit a few fields. Perhaps you're a developer of the system and know of some un-documented approaches?
Author
There was a problem hiding this comment.
I was basing it on the Simple SMS API (HTTP) https://gatewayapi.com/docs/apis/simple/
Owner
There was a problem hiding this comment.
Fair enough; get it working for you and I can help you with test cases.
- Improve test coverage from 89.79% to 100% - Add sender field validation (alphanumeric 1-11 chars or numeric 1-15 digits) - Add tests for URL parsing, privacy mode, empty targets, and sender validation - Fix test case expectation for mixed valid/invalid targets Test improvements: - test_plugin_gatewayapi_url_parsing: Tests API key in password field, key query param, 'to' param, URL privacy mode - test_plugin_gatewayapi_length_method: Tests __len__() with various target configurations - test_plugin_gatewayapi_url_identifier: Tests url_identifier property - test_plugin_gatewayapi_empty_targets: Tests notification with no targets - test_plugin_gatewayapi_sender_validation: Comprehensive sender field validation tests Security enhancements: - Validates sender against GatewayAPI specifications - Prevents injection via sender field - Gracefully handles invalid senders with warnings 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
…uest Updated the send() method to comply with GatewayAPI's Simple SMS API specification by sending all recipients in a single API request using array indexing (recipients.0.msisdn, recipients.1.msisdn, etc.) instead of making separate API calls for each recipient. Benefits: - Reduced API calls from N (one per recipient) to 1 (single batched request) - Improved efficiency for bulk messaging - Better rate limit utilization - Full conformance with GatewayAPI Simple SMS API specification Updated tests to verify batching behavior and maintained 100% test coverage. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for GatewayAPI SMS notifications to Apprise.
Features
Implementation Details
apprise/plugins/gatewayapi.pytests/test_plugin_gatewayapi.pygatewayapi://{apikey}@{phone_numbers}from(sender name/number),key(alias for API key),to(additional targets)Testing
Comprehensive test coverage includes:
Test Results
Example Usage
🤖 Generated with Claude Code