Add a Plivo app for sending SMS - #454
Open
sarveshpatil-plivo wants to merge 2 commits into
Open
Conversation
Add a Plivo Messages app (plivo/1.0.0) that sends SMS from a workflow, mirroring the structure of the existing twilio app. Contract (Plivo Messages API): - POST https://api.plivo.com/v1/Account/{AUTH_ID}/Message/ - HTTP Basic auth (Auth ID / Auth Token) - JSON body {src, dst, text, type: "sms"} - multiple recipients joined into one dst with "<" - send-only; no inbound webhook, so no signature verification needed Intentional divergences from the twilio app (hardening, not copied bugs): - success is derived from the HTTP status (2xx, including Plivo's 202 on queue) instead of hardcoded True, so a failed send reports success=False - guard against an empty recipient list before calling the API - defensive timeout parse (fall back to the default on bad/zero input) - send the SMS text verbatim (no ast.literal_eval); dropped the now-unused checkbody helper - returns.example documents the summary wrapper (the raw Plivo body is under results[0].body) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- wrap the send in try/except so network errors are reported, not raised - drop ghost/no-op auth branch and unused run() reads carried from the template - narrow the bare except; reflect the actual HTTP status (Plivo returns 202) - replace the placeholder icon with the current Plivo brand logo
Author
|
Hi @0x0elliot (cc @frikky), this adds a Plivo SMS app, following the existing app pattern (relates to Shuffle/Shuffle#1991). Would you be able to take a look when you get a chance? Happy to adjust anything. |
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.
This adds a plivo app under plivo/1.0.0/, following the existing app conventions, with a single Send SMS action. Relates to Shuffle/Shuffle#1991.
What it does
A Basic auth REST wrapper around the Plivo Messages API. You provide your account message URL, Auth ID, and Auth Token, and the action sends an SMS. Multiple recipients can be passed as a comma separated list and are sent in one request.
Scope
Current scope is SMS only. Voice and other Plivo services can follow as additional actions later.
Notes
Success is read from the HTTP status, so a failed send surfaces as an error instead of passing silently, and empty recipients and invalid timeouts are handled. The request shape matches the Plivo Messages API and the app manifest validates.
Happy to adjust anything to fit your conventions.