This is the start of a library for Twilio. Gotwilio supports making voice calls and sending text messages.
Gotwilio is licensed under a BSD license.
To install gotwilio, simply run go get github.com/sfreiberg/gotwilio
.
package main
import (
"github.com/sfreiberg/gotwilio"
)
func main() {
accountSid := "ABC123..........ABC123"
authToken := "ABC123..........ABC123"
twilio := gotwilio.NewTwilioClient(accountSid, authToken)
from := "+15555555555"
to := "+15555555555"
message := "Welcome to gotwilio!"
twilio.SendSMS(from, to, message, "", "")
}
package main
import (
"github.com/sfreiberg/gotwilio"
)
func main() {
accountSid := "ABC123..........ABC123"
authToken := "ABC123..........ABC123"
twilio := gotwilio.NewTwilioClient(accountSid, authToken)
from := "+15555555555"
to := "+15555555555"
message := "Welcome to gotwilio!"
mediaUrl := []string{"http://host/myimage.gif"}
twilio.SendMMS(from, to, message, mediaUrl, "", "")
}
package main
import (
"github.com/sfreiberg/gotwilio"
)
func main() {
accountSid := "ABC123..........ABC123"
authToken := "ABC123..........ABC123"
twilio := gotwilio.NewTwilioClient(accountSid, authToken)
from := "+15555555555"
to := "+15555555555"
callbackParams := gotwilio.NewCallbackParameters("http://example.com")
twilio.CallWithUrlCallbacks(from, to, callbackParams)
}
package main
import (
"github.com/sfreiberg/gotwilio"
)
func main() {
accountSid := "ABC123..........ABC123"
authToken := "ABC123..........ABC123"
twilio := gotwilio.NewTwilioClient(accountSid, authToken)
twilio.CreateVideoRoom(gotwilio.DefaultVideoRoomOptions)
}