Versions in this module Expand all Collapse all v1 v1.0.0 Dec 22, 2021 Changes in this version + const APISearchLayout + const APIVersion + const AnsweredByHuman + const AnsweredByMachine + const CodeAccountSuspended + const CodeCarrierViolation + const CodeDocumentParseFailure + const CodeForbiddenPhoneNumber + const CodeHTTPConnectionFailure + const CodeHTTPProtocolViolation + const CodeHTTPRetrievalFailure + const CodeLandline + const CodeMessageBlocked + const CodeMessagePriceExceedsMaxPrice + const CodeMissingSegment + const CodeNoInternationalAuthorization + const CodeQueueOverflow + const CodeReplyLimitExceeded + const CodeSayInvalidText + const CodeUnknownDestination + const CodeUnknownError + const CodeUnreachable + const DirectionInbound + const DirectionOutboundAPI + const DirectionOutboundCall + const DirectionOutboundDial + const DirectionOutboundReply + const DirectionTrunkingOriginating + const DirectionTrunkingTerminating + const LogLevelDebug + const LogLevelError + const LogLevelNotice + const LogLevelWarning + const MonitorVersion + const PricingVersion + const StatusAccepted + const StatusActive + const StatusBusy + const StatusCanceled + const StatusClosed + const StatusCompleted + const StatusDelivered + const StatusFailed + const StatusInProgress + const StatusNoAnswer + const StatusQueued + const StatusReceived + const StatusReceiving + const StatusRinging + const StatusSending + const StatusSent + const StatusSuspended + const StatusUndelivered + const TimeLayout + const Version + var BaseURL = "https://api.twilio.com" + var Epoch = time.Date(2005, 1, 1, 0, 0, 0, 0, time.UTC) + var ErrEmptyNumber = errors.New("twilio: The provided phone number was empty") + var HeatDeath = time.Date(6000, 1, 1, 0, 0, 0, 0, time.UTC) + var MediaClient = http.Client + var MonitorBaseURL = "https://monitor.twilio.com" + var NoMoreResults = errors.New("twilio: No more results") + var PricingBaseURL = "https://pricing.twilio.com" + func GetExpectedTwilioSignature(host string, authToken string, URL string, postForm url.Values) (expectedTwilioSignature string) + func ValidateIncomingRequest(host string, authToken string, req *http.Request) (err error) + type Account struct + AuthToken string + DateCreated TwilioTime + DateUpdated TwilioTime + FriendlyName string + OwnerAccountSid string + Sid string + Status Status + SubresourceURIs map[string]string + Type string + URI string + type AccountPage struct + Accounts []*Account + type AccountPageIterator struct + func (c *AccountPageIterator) Next(ctx context.Context) (*AccountPage, error) + type AccountService struct + func (a *AccountService) Create(ctx context.Context, data url.Values) (*Account, error) + func (a *AccountService) Get(ctx context.Context, sid string) (*Account, error) + func (a *AccountService) GetPage(ctx context.Context, data url.Values) (*AccountPage, error) + func (a *AccountService) Update(ctx context.Context, sid string, data url.Values) (*Account, error) + func (c *AccountService) GetPageIterator(data url.Values) *AccountPageIterator + type Alert struct + APIVersion string + AccountSid string + AlertText string + DateCreated TwilioTime + DateGenerated TwilioTime + DateUpdated TwilioTime + ErrorCode Code + LogLevel LogLevel + MoreInfo string + RequestMethod string + RequestURL string + RequestVariables Values + ResourceSid string + ResponseBody string + ResponseHeaders Values + ServiceSid json.RawMessage + Sid string + URL string + func (a *Alert) Description() string + func (a *Alert) StatusCode() int + type AlertPage struct + Alerts []*Alert + Meta Meta + type AlertPageIterator interface + Next func(context.Context) (*AlertPage, error) + type AlertService struct + func (a *AlertService) Get(ctx context.Context, sid string) (*Alert, error) + func (a *AlertService) GetAlertsInRange(start time.Time, end time.Time, data url.Values) AlertPageIterator + func (a *AlertService) GetNextAlertsInRange(start time.Time, end time.Time, nextPageURI string) AlertPageIterator + func (a *AlertService) GetPage(ctx context.Context, data url.Values) (*AlertPage, error) + func (a *AlertService) GetPageIterator(data url.Values) AlertPageIterator + type AnsweredBy string + type Application struct + APIVersion string + AccountSid string + DateCreated TwilioTime + DateUpdated TwilioTime + FriendlyName string + MessageStatusCallback string + SMSFallbackMethod string + SMSFallbackURL string + SMSURL string + Sid string + StatusCallback string + StatusCallbackMethod string + URI string + VoiceCallerIDLookup bool + VoiceFallbackMethod string + VoiceFallbackURL string + VoiceMethod string + VoiceURL string + type ApplicationPage struct + Applications []*Application + type ApplicationPageIterator struct + func (c *ApplicationPageIterator) Next(ctx context.Context) (*ApplicationPage, error) + type ApplicationService struct + func (a *ApplicationService) Update(ctx context.Context, sid string, data url.Values) (*Application, error) + func (c *ApplicationService) Create(ctx context.Context, data url.Values) (*Application, error) + func (c *ApplicationService) Get(ctx context.Context, sid string) (*Application, error) + func (c *ApplicationService) GetPage(ctx context.Context, data url.Values) (*ApplicationPage, error) + func (c *ApplicationService) GetPageIterator(data url.Values) *ApplicationPageIterator + func (r *ApplicationService) Delete(ctx context.Context, sid string) error + type Call struct + APIVersion string + AccountSid string + Annotation json.RawMessage + AnsweredBy NullAnsweredBy + CallerName types.NullString + DateCreated TwilioTime + DateUpdated TwilioTime + Direction Direction + Duration TwilioDuration + EndTime TwilioTime + ForwardedFrom PhoneNumber + From PhoneNumber + GroupSid string + ParentCallSid string + PhoneNumberSid string + Price string + PriceUnit string + Sid string + StartTime TwilioTime + Status Status + To PhoneNumber + URI string + func (c *Call) Ended() bool + func (c *Call) EndedUnsuccessfully() bool + func (c *Call) FriendlyPrice() string + type CallPage struct + Calls []*Call + type CallPageIterator interface + Next func(context.Context) (*CallPage, error) + type CallService struct + func (c *CallService) Cancel(sid string) (*Call, error) + func (c *CallService) Create(ctx context.Context, data url.Values) (*Call, error) + func (c *CallService) Get(ctx context.Context, sid string) (*Call, error) + func (c *CallService) GetCallsInRange(start time.Time, end time.Time, data url.Values) CallPageIterator + func (c *CallService) GetNextCallsInRange(start time.Time, end time.Time, nextPageURI string) CallPageIterator + func (c *CallService) GetPage(ctx context.Context, data url.Values) (*CallPage, error) + func (c *CallService) GetPageIterator(data url.Values) CallPageIterator + func (c *CallService) GetRecordings(ctx context.Context, callSid string, data url.Values) (*RecordingPage, error) + func (c *CallService) GetRecordingsIterator(callSid string, data url.Values) *RecordingPageIterator + func (c *CallService) Hangup(sid string) (*Call, error) + func (c *CallService) MakeCall(from string, to string, u *url.URL) (*Call, error) + func (c *CallService) Redirect(sid string, u *url.URL) (*Call, error) + func (c *CallService) Update(ctx context.Context, sid string, data url.Values) (*Call, error) + type CallerIDRequest struct + AccountSid string + CallSid string + FriendlyName string + PhoneNumber PhoneNumber + ValidationCode string + type Client struct + APIVersion string + AccountSid string + Accounts *AccountService + Alerts *AlertService + Applications *ApplicationService + AuthToken string + Calls *CallService + Conferences *ConferenceService + FullPath func(pathPart string) string + IncomingNumbers *IncomingNumberService + Keys *KeyService + Media *MediaService + Messages *MessageService + Messaging *MessagingPriceService + Monitor *Client + OutgoingCallerIDs *OutgoingCallerIDService + PhoneNumbers *PhoneNumberPriceService + Pricing *Client + Queues *QueueService + Recordings *RecordingService + Transcriptions *TranscriptionService + Voice *VoicePriceService + func NewClient(accountSid string, authToken string, httpClient *http.Client) *Client + func NewMonitorClient(accountSid string, authToken string, httpClient *http.Client) *Client + func NewPricingClient(accountSid string, authToken string, httpClient *http.Client) *Client + func (c *Client) CreateResource(ctx context.Context, pathPart string, data url.Values, v interface{}) error + func (c *Client) DeleteResource(ctx context.Context, pathPart string, sid string) error + func (c *Client) GetNextPage(ctx context.Context, fullUri string, v interface{}) error + func (c *Client) GetResource(ctx context.Context, pathPart string, sid string, v interface{}) error + func (c *Client) ListResource(ctx context.Context, pathPart string, data url.Values, v interface{}) error + func (c *Client) MakeRequest(ctx context.Context, method string, pathPart string, data url.Values, ...) error + func (c *Client) RequestOnBehalfOf(subaccountSid string) + func (c *Client) UpdateResource(ctx context.Context, pathPart string, sid string, data url.Values, ...) error + type Code int + func (c *Code) UnmarshalJSON(b []byte) error + type Conference struct + APIVersion string + AccountSid string + DateCreated TwilioTime + DateUpdated TwilioTime + FriendlyName string + Region string + Sid string + Status Status + URI string + type ConferencePage struct + Conferences []*Conference + type ConferencePageIterator interface + Next func(context.Context) (*ConferencePage, error) + type ConferenceService struct + func (c *ConferenceService) Get(ctx context.Context, sid string) (*Conference, error) + func (c *ConferenceService) GetConferencesInRange(start time.Time, end time.Time, data url.Values) ConferencePageIterator + func (c *ConferenceService) GetNextConferencesInRange(start time.Time, end time.Time, nextPageURI string) ConferencePageIterator + func (c *ConferenceService) GetPage(ctx context.Context, data url.Values) (*ConferencePage, error) + func (c *ConferenceService) GetPageIterator(data url.Values) ConferencePageIterator + type CountriesPricePage struct + Countries []*PriceCountry + Meta Meta + type CountryMessagingPriceService struct + func (cmps *CountryMessagingPriceService) Get(ctx context.Context, isoCountry string) (*MessagePrice, error) + func (cmps *CountryMessagingPriceService) GetPage(ctx context.Context, data url.Values) (*CountriesPricePage, error) + func (cmps *CountryMessagingPriceService) GetPageIterator(data url.Values) *CountryPricePageIterator + type CountryPhoneNumberPriceService struct + func (cpnps *CountryPhoneNumberPriceService) Get(ctx context.Context, isoCountry string) (*NumberPrice, error) + func (cpnps *CountryPhoneNumberPriceService) GetPage(ctx context.Context, data url.Values) (*CountriesPricePage, error) + func (cpnps *CountryPhoneNumberPriceService) GetPageIterator(data url.Values) *CountryPricePageIterator + type CountryPricePageIterator struct + func (c *CountryPricePageIterator) Next(ctx context.Context) (*CountriesPricePage, error) + type CountryVoicePriceService struct + func (cvps *CountryVoicePriceService) Get(ctx context.Context, isoCountry string) (*VoicePrice, error) + func (cvps *CountryVoicePriceService) GetPage(ctx context.Context, data url.Values) (*CountriesPricePage, error) + func (cvps *CountryVoicePriceService) GetPageIterator(data url.Values) *CountryPricePageIterator + type Direction string + func (d Direction) Friendly() string + type InboundPrice struct + BasePrice string + CurrentPrice string + NumberType string + type IncomingNumberService struct + Local *NumberPurchasingService + TollFree *NumberPurchasingService + func (c *IncomingNumberService) GetPageIterator(data url.Values) *IncomingPhoneNumberPageIterator + func (ins *IncomingNumberService) GetPage(ctx context.Context, data url.Values) (*IncomingPhoneNumberPage, error) + func (ipn *IncomingNumberService) BuyNumber(phoneNumber string) (*IncomingPhoneNumber, error) + func (ipn *IncomingNumberService) Get(ctx context.Context, sid string) (*IncomingPhoneNumber, error) + func (ipn *IncomingNumberService) Release(ctx context.Context, sid string) error + type IncomingPhoneNumber struct + APIVersion string + AccountSid string + AddressRequirements string + Beta bool + Capabilities *NumberCapability + DateCreated TwilioTime + DateUpdated TwilioTime + EmergencyAddressSid types.NullString + EmergencyStatus string + FriendlyName string + PhoneNumber PhoneNumber + SMSApplicationSid string + SMSFallbackMethod string + SMSFallbackURL string + SMSMethod string + SMSURL string + Sid string + StatusCallback string + StatusCallbackMethod string + TrunkSid types.NullString + URI string + VoiceApplicationSid string + VoiceCallerIDLookup bool + VoiceFallbackMethod string + VoiceFallbackURL string + VoiceMethod string + VoiceURL string + type IncomingPhoneNumberPage struct + IncomingPhoneNumbers []*IncomingPhoneNumber + type IncomingPhoneNumberPageIterator struct + func (c *IncomingPhoneNumberPageIterator) Next(ctx context.Context) (*IncomingPhoneNumberPage, error) + type Key struct + DateCreated TwilioTime + DateUpdated TwilioTime + FriendlyName string + Secret string + Sid string + type KeyPage struct + Keys []*Key + type KeyPageIterator struct + func (c *KeyPageIterator) Next(ctx context.Context) (*KeyPage, error) + type KeyService struct + func (a *KeyService) Update(ctx context.Context, sid string, data url.Values) (*Key, error) + func (c *KeyService) Create(ctx context.Context, data url.Values) (*Key, error) + func (c *KeyService) Get(ctx context.Context, sid string) (*Key, error) + func (c *KeyService) GetPage(ctx context.Context, data url.Values) (*KeyPage, error) + func (c *KeyService) GetPageIterator(data url.Values) *KeyPageIterator + func (r *KeyService) Delete(ctx context.Context, sid string) error + type LogLevel string + func (l LogLevel) Friendly() string + type Media struct + AccountSid string + ContentType string + DateCreated TwilioTime + DateUpdated TwilioTime + ParentSid string + Sid string + URI string + type MediaPage struct + MediaList []*Media + type MediaService struct + func (m *MediaService) Get(ctx context.Context, messageSid string, sid string) (*Media, error) + func (m *MediaService) GetImage(ctx context.Context, messageSid string, sid string) (image.Image, error) + func (m *MediaService) GetPage(ctx context.Context, messageSid string, data url.Values) (*MediaPage, error) + func (m *MediaService) GetURL(ctx context.Context, messageSid string, sid string) (*url.URL, error) + type Message struct + APIVersion string + AccountSid string + Body string + DateCreated TwilioTime + DateSent TwilioTime + DateUpdated TwilioTime + Direction Direction + ErrorCode Code + ErrorMessage string + From PhoneNumber + MessagingServiceSid types.NullString + NumMedia NumMedia + NumSegments Segments + Price string + PriceUnit string + Sid string + Status Status + SubresourceURIs map[string]string + To PhoneNumber + URI string + func (m *Message) FriendlyPrice() string + type MessagePage struct + Messages []*Message + type MessagePageIterator interface + Next func(context.Context) (*MessagePage, error) + type MessagePrice struct + Country string + InboundSmsPrices []InboundPrice + IsoCountry string + OutboundSMSPrices []OutboundSMSPrice + PriceUnit string + URL string + type MessageService struct + func (c *MessageService) GetMessagesInRange(start time.Time, end time.Time, data url.Values) MessagePageIterator + func (c *MessageService) GetNextMessagesInRange(start time.Time, end time.Time, nextPageURI string) MessagePageIterator + func (m *MessageService) Create(ctx context.Context, data url.Values) (*Message, error) + func (m *MessageService) Get(ctx context.Context, sid string) (*Message, error) + func (m *MessageService) GetMediaURLs(ctx context.Context, sid string, data url.Values) ([]*url.URL, error) + func (m *MessageService) GetPage(ctx context.Context, data url.Values) (*MessagePage, error) + func (m *MessageService) GetPageIterator(data url.Values) MessagePageIterator + func (m *MessageService) SendMessage(from string, to string, body string, mediaURLs []*url.URL) (*Message, error) + type MessagingPriceService struct + Countries *CountryMessagingPriceService + type Meta struct + FirstPageURL string + Key string + NextPageURL types.NullString + Page uint + PageSize uint + PreviousPageURL types.NullString + type NullAnsweredBy struct + AnsweredBy AnsweredBy + Valid bool + type NumMedia uintStr + func (n *NumMedia) UnmarshalJSON(b []byte) (err error) + type NumberCapability struct + MMS bool + SMS bool + Voice bool + type NumberPrice struct + Country string + IsoCountry string + PhoneNumberPrices []PhoneNumberPrice + PriceUnit string + URL string + type NumberPurchasingService struct + func (n *NumberPurchasingService) Create(ctx context.Context, data url.Values) (*IncomingPhoneNumber, error) + type NumberVoicePriceService struct + func (nvps *NumberVoicePriceService) Get(ctx context.Context, number string) (*VoiceNumberPrice, error) + type OutboundCallPrice struct + BasePrice string + CurrentPrice string + type OutboundSMSPrice struct + Carrier string + MCC string + MNC string + Prices []InboundPrice + type OutgoingCallerID struct + AccountSid string + DateCreated TwilioTime + DateUpdated TwilioTime + FriendlyName string + PhoneNumber PhoneNumber + Sid string + URI string + type OutgoingCallerIDPage struct + OutgoingCallerIDs []*OutgoingCallerID + type OutgoingCallerIDPageIterator struct + func (o *OutgoingCallerIDPageIterator) Next(ctx context.Context) (*OutgoingCallerIDPage, error) + type OutgoingCallerIDService struct + func (c *OutgoingCallerIDService) Create(ctx context.Context, data url.Values) (*CallerIDRequest, error) + func (o *OutgoingCallerIDService) Delete(ctx context.Context, sid string) error + func (o *OutgoingCallerIDService) Get(ctx context.Context, sid string) (*OutgoingCallerID, error) + func (o *OutgoingCallerIDService) GetPage(ctx context.Context, data url.Values) (*OutgoingCallerIDPage, error) + func (o *OutgoingCallerIDService) GetPageIterator(data url.Values) *OutgoingCallerIDPageIterator + func (o *OutgoingCallerIDService) Update(ctx context.Context, sid string, data url.Values) (*OutgoingCallerID, error) + type Page struct + End uint + FirstPageURI string + NextPageURI types.NullString + NumPages uint + PageSize uint + PreviousPageURI types.NullString + Start uint + Total uint + type PageIterator struct + func NewNextPageIterator(client *Client, nextPageURI string) *PageIterator + func NewPageIterator(client *Client, data url.Values, pathPart string) *PageIterator + func (p *PageIterator) Next(ctx context.Context, v interface{}) error + func (p *PageIterator) SetNextPageURI(npuri types.NullString) + type Participant struct + AccountSid string + CallSid string + ConferenceSid string + DateCreated TwilioTime + DateUpdated TwilioTime + EndConferenceOnExit bool + Hold bool + Muted bool + StartConferenceOnEnter bool + URI string + type ParticipantService struct + type PhoneNumber string + func NewPhoneNumber(pn string) (PhoneNumber, error) + func (pn PhoneNumber) Friendly() string + func (pn PhoneNumber) Local() string + type PhoneNumberPrice struct + BasePrice string + CurrentPrice string + NumberType string + type PhoneNumberPriceService struct + Countries *CountryPhoneNumberPriceService + type PrefixPrice struct + BasePrice string + CurrentPrice string + FriendlyName string + Prefixes []string + type PriceCountry struct + Country string + IsoCountry string + URL string + type Queue struct + AccountSid string + AverageWaitTime uint + CurrentSize uint + DateCreated TwilioTime + DateUpdated TwilioTime + FriendlyName string + MaxSize uint + Sid string + URI string + type QueuePage struct + Queues []*Queue + type QueuePageIterator struct + func (c *QueuePageIterator) Next(ctx context.Context) (*QueuePage, error) + type QueueService struct + func (c *QueueService) Create(ctx context.Context, data url.Values) (*Queue, error) + func (c *QueueService) Delete(ctx context.Context, sid string) error + func (c *QueueService) Get(ctx context.Context, sid string) (*Queue, error) + func (c *QueueService) GetPage(ctx context.Context, data url.Values) (*QueuePage, error) + func (c *QueueService) GetPageIterator(data url.Values) *QueuePageIterator + type Recording struct + APIVersion string + AccountSid string + CallSid string + Channels uint + DateCreated TwilioTime + DateUpdated TwilioTime + Duration TwilioDuration + Price string + PriceUnit string + Sid string + Status Status + URI string + func (r *Recording) FriendlyPrice() string + func (r *Recording) URL(extension string) string + type RecordingPage struct + Recordings []*Recording + type RecordingPageIterator struct + func (r *RecordingPageIterator) Next(ctx context.Context) (*RecordingPage, error) + type RecordingService struct + func (r *RecordingService) Delete(ctx context.Context, sid string) error + func (r *RecordingService) Get(ctx context.Context, sid string) (*Recording, error) + func (r *RecordingService) GetPage(ctx context.Context, data url.Values) (*RecordingPage, error) + func (r *RecordingService) GetPageIterator(data url.Values) *RecordingPageIterator + func (r *RecordingService) GetTranscriptions(ctx context.Context, recordingSid string, data url.Values) (*TranscriptionPage, error) + type Segments uintStr + func (seg *Segments) UnmarshalJSON(b []byte) (err error) + type Status string + func (s Status) Friendly() string + type Transcription struct + APIVersion string + AccountSid string + DateCreated TwilioTime + DateUpdated TwilioTime + Duration TwilioDuration + Price string + PriceUnit string + RecordingSid string + Sid string + Status Status + TranscriptionText string + Type string + URI string + func (t *Transcription) FriendlyPrice() string + type TranscriptionPage struct + Transcriptions []*Transcription + type TranscriptionPageIterator struct + func (c *TranscriptionPageIterator) Next(ctx context.Context) (*TranscriptionPage, error) + type TranscriptionService struct + func (c *TranscriptionService) Delete(ctx context.Context, sid string) error + func (c *TranscriptionService) Get(ctx context.Context, sid string) (*Transcription, error) + func (c *TranscriptionService) GetPage(ctx context.Context, data url.Values) (*TranscriptionPage, error) + func (c *TranscriptionService) GetPageIterator(data url.Values) *TranscriptionPageIterator + type TwilioDuration time.Duration + func (td *TwilioDuration) UnmarshalJSON(b []byte) error + func (td TwilioDuration) String() string + type TwilioTime struct + Time time.Time + Valid bool + func NewTwilioTime(val string) *TwilioTime + func (t *TwilioTime) UnmarshalJSON(b []byte) error + func (tt *TwilioTime) MarshalJSON() ([]byte, error) + type Values struct + func (h *Values) UnmarshalJSON(b []byte) error + type VoiceNumberPrice struct + Country string + InboundCallPrice InboundPrice + IsoCountry string + Number string + OutboundCallPrice OutboundCallPrice + PriceUnit string + URL string + type VoicePrice struct + Country string + InboundCallPrices []InboundPrice + IsoCountry string + OutboundPrefixPrices []PrefixPrice + PriceUnit string + URL string + type VoicePriceService struct + Countries *CountryVoicePriceService + Numbers *NumberVoicePriceService