Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
common Exporting BaseURL so tests in other modules can change it Aug 5, 2014
conference adding filter for participant list Jul 26, 2014
queues fixing conflict Sep 9, 2014
sms fix check_apps example Sep 8, 2014
transcription renaming to ResourceInfo Jul 22, 2014
usage renaming to ResourceInfo Jul 22, 2014
.gitignore satisfying golint Jul 10, 2014
.travis.yml updating travis config Sep 15, 2014 expanding README Jul 21, 2014

Twilio Go

alt text Build Status

Write Twilio applications with our Go helper library. To get started, there are some example applications in the examples folder.

All Twilio API calls are validated at runtime to insure that all necesary information is provided.

You can generate a callback parser for all Twilio callbacks that will publish the parsed callbacks into a channel. See the SMS example below for an example of how this works.


go get


Linking your account(s)

You can manage your credentials either through environment variables or manually setting them. The library will panic if you attempt to input an invalid AccountSid or token.

Environment Variables

export TWILIO_ACCOUNT="accountsid"
export TWILIO_TOKEN="accounttoken"
act := twilogo.NewAccountFromEnv()

Manual Setting

act := twiliogo.NewAccount("AccountSid", "AccountToken")

Making a call

act := twilogo.NewAccountFromEnv()

resp, err := act.Voice.Call(voice.Post{
	From: "+{ Your Twilio Number }",
	To:   "+{ Your Destination Number }",
	URL:  "",

Sending a text - with a callback handler

act := twilogo.NewAccountFromEnv()

resp, err := act.Sms.Send(sms.Post{
	From:           "+{ Your Twilio Number }",
	To:             "+{ Your Destination Number }",
	Body:           "Ready to become a Go-ru?",
	StatusCallback: "{ Your IP/DNS }/sms_callback",

smsChan := make(chan sms.Callback)
go func(callbackChan chan sms.Callback){
	for {
		smsCallback <- callbackChan
		// process smsCallback as desired

// Register the sms callback handler
// All incoming SMS callbacks will be parsed and sent into "smsChan"
http.Handle("/sms_callback", sms.CallbackHandler(smsChan))

http.ListenAndServe("", nil)
You can’t perform that action at this time.