Categorygithub.com/CirqleDevs/go-twilio
modulepackage
0.0.0-20200701210447-20b4a0223a4c
Repository: https://github.com/cirqledevs/go-twilio.git
Documentation: pkg.go.dev

# README

Overview

This is the start of a library for Twilio. Gotwilio supports making voice calls and sending text messages.

License

Gotwilio is licensed under a BSD license.

Installation

To install gotwilio, simply run go get github.com/sfreiberg/gotwilio.

SMS Example

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, "", "")
}

MMS Example

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.SendMMS(from, to, message, "http://host/myimage.gif", "", "")
}

Voice Example

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)
}

Video example

package main

import (
	"github.com/sfreiberg/gotwilio"
)

func main() {
	accountSid := "ABC123..........ABC123"
	authToken := "ABC123..........ABC123"
	twilio := gotwilio.NewTwilioClient(accountSid, authToken)

	twilio.CreateVideoRoom(gotwilio.DefaultVideoRoomOptions)
}

# Functions

No description provided by the author
NewBoolean returns a boolean pointer value for a given boolean literal.
NewCallbackParameters returns a CallbackParameters type with the specified url and CallbackParameters.Timeout set to 60.
Create a new Twilio struct.
Create a new Twilio client, optionally using a custom http.Client.
ParseSmsStatus checks the validity of the Sms Status value.
ParseSmsStatus checks the validity of the Voice Call Status value.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
https://www.twilio.com/docs/proxy/api/pb-proxy-service.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
queued, ringing, in-progress, completed, busy, failed or no-answer.
queued, ringing, in-progress, completed, busy, failed or no-answer.
queued, ringing, in-progress, completed, busy, failed or no-answer.
queued, ringing, in-progress, completed, busy, failed or no-answer.
queued, ringing, in-progress, completed, busy, failed or no-answer.
queued, ringing, in-progress, completed, busy, failed or no-answer.
queued, ringing, in-progress, completed, busy, failed or no-answer.
No description provided by the author

# Variables

DefaultVideoRoomOptions are the default options for creating a room.

# Structs

AccessToken holds everything required to create authenticate the client SDKs.
AvailablePhoneNumber represents a Twilio phone number available for purchase https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource.
AvailablePhoneNumbersOptions are all of the options that can be passed to an GetAvailablePhoneNumber query.
These are the paramters to use when you want Twilio to use callback urls.
Conference represents a Twilio Voice conference call.
ConferenceOptions are used for updating Conferences.
ConferenceParticipant represents a Participant in responses from the Twilio API.
ConferenceParticipantOptions are used for creating and updating Conference Participants.
Exception is a representation of a twilio exception.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
IncomingPhoneNumber represents a phone number resource owned by the calling account in Twilio.
No description provided by the author
No description provided by the author
No description provided by the author
ListResources contains Twilio paging information.
ListVideoResponse is returned when listing rooms.
ListVideoRoomOptions are the options to query for a list of video rooms.
Lookup Go-representation of Twilio REST API's lookup.
LookupReq Go-representation of Twilio REST API's lookup request.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
https://www.twilio.com/docs/proxy/api/proxy-webhooks#callbackurl These webhooks are fired for each new interaction and are informational only.
https://www.twilio.com/docs/proxy/api/proxy-webhooks#interceptcallbackurl Fires on each interaction.
No description provided by the author
https://www.twilio.com/docs/proxy/api/proxy-webhooks#outofsessioncallbackurl A URL to send webhooks to when an action (inbound call or SMS) occurs where there is no session or a closed session.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
SmsResponse is returned after a text/sms message is posted to Twilio.
https://www.twilio.com/docs/sms/twiml#request-parameters SMS webhooks received from inbound SMS messages.
Twilio stores basic information important for connecting to the twilio.com REST api such as AccountSid and AuthToken.
These are the parameters to use when you are requesting account usage.
UsageRecord specifies the usage for a particular usage category.
UsageResponse contains information about account usage.
VideoGrant is the permission to use the Video API which can be given to an Access Token.
VideoResponse is returned for a single room.
VoiceGrant is the permission to use the Voice API and act as a Twilio Client.
VoiceGrantIncoming represents the incoming options for a voice grant.
VoiceGrantOutgoing represents the outgoing options for a voice grant.
VoiceResponse contains the details about successful voice calls.

# Interfaces

Grant is a perimssion given to the Access Token.
No description provided by the author

# Type aliases

No description provided by the author
MediaRegion is the locations of Twilio's TURN servers.
PhoneNumberType defines whether a phone number is local, toll-free, or mobile.
SmsStatus represents the status of the message sent to the twilio callback webhook.
VideoCodecs are the supported codecs when publishing a track to the room.
VideoRoomType is how the participants connect to each other, whether peer-to-peer of routed through a TURN server.
VideoStatus is the status of a video room.
VoiceStatus represents the possible values returned from the twilio callback webhook.