https://github.com/zackproser/speakeasy
A simple golang package for sending SMS and making calls with Twilio
https://github.com/zackproser/speakeasy
Last synced: 5 days ago
JSON representation
A simple golang package for sending SMS and making calls with Twilio
- Host: GitHub
- URL: https://github.com/zackproser/speakeasy
- Owner: zackproser
- License: mit
- Created: 2017-09-10T18:40:26.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-19T16:11:00.000Z (over 8 years ago)
- Last Synced: 2025-03-04T17:40:50.015Z (about 1 year ago)
- Language: Go
- Size: 263 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Speakeasy

A very simple package for sending SMS messages and making calls with a Twilio account.
## Methods
### SMS(to, body)
Generate an outbound SMS message
### Call(to, twimlUrl)
Generate an outbound Twilio call to the supplied number. Twilio will attempt to parse TwiML served up at the supplied twimlUrl.
## Usage
```go
package main
import (
"fmt"
"github.com/zackproser/speakeasy"
)
func main() {
//Instantiate Speakeasy with your account SID, AuthToken and Twilio number
s := speakeasy.New("AC49a43r78fh717463fce21dsfue6ae", "8211129a9d43c587eftxbdh39c859666", "+555-555-5555")
//Send an SMS
res, err := s.SMS("+14158675309", "Hello from Speakeasy")
if err != nil {
fmt.Printf("Error sending SMS: %v", err)
}
fmt.Printf("Response: %v", res)
//Make a phone call
callRes, callErr := s.Call("+15103267023", "http://twimlets.com/echo?Twiml=%3CResponse%3E%3CSay%3EWelcome+to+speak+easy.%3C%2FSay%3E%3C%2FResponse%3E")
if callErr != nil {
fmt.Printf("Error making Call: %v", callErr)
}
fmt.Printf("Response: %v", callRes)
}
```
### Documentation
[Godocs](https://godoc.org/github.com/zackproser/speakeasy)