Documentation ¶
Index ¶
- Constants
- type Account
- type AccountTransaction
- type Application
- type ApplicationData
- type AvailableNumber
- type AvailableNumberType
- type Bridge
- type BridgeData
- type Call
- type CallEvent
- type Client
- func (api *Client) AnswerIncomingCall(id string) error
- func (api *Client) CreateApplication(data *ApplicationData) (string, error)
- func (api *Client) CreateBridge(data *BridgeData) (string, error)
- func (api *Client) CreateCall(data *CreateCallData) (string, error)
- func (api *Client) CreateConference(data *CreateConferenceData) (string, error)
- func (api *Client) CreateConferenceMember(id string, data *CreateConferenceMemberData) (string, error)
- func (api *Client) CreateDomain(data *CreateDomainData) (string, error)
- func (api *Client) CreateDomainEndpoint(id string, data *DomainEndpointData) (string, error)
- func (api *Client) CreateDomainEndpointToken(id, endpointID string) (*DomainEndpointToken, error)
- func (api *Client) CreateGather(id string, data *CreateGatherData) (string, error)
- func (api *Client) CreateMessage(data *CreateMessageData) (string, error)
- func (api *Client) CreateMessageV2(data *CreateMessageDataV2, other ...string) (*CreateMessageResultV2, error)
- func (api *Client) CreateMessages(data ...*CreateMessageData) ([]*CreateMessageResult, error)
- func (api *Client) CreatePhoneNumber(data *CreatePhoneNumberData) (string, error)
- func (api *Client) CreateRecordingTranscription(id string) (string, error)
- func (api *Client) DeleteApplication(id string) error
- func (api *Client) DeleteConferenceMember(id string, memberID string) error
- func (api *Client) DeleteDomain(id string) error
- func (api *Client) DeleteDomainEndpoint(id string, endpointID string) error
- func (api *Client) DeleteMediaFile(name string) error
- func (api *Client) DeletePhoneNumber(id string) error
- func (api *Client) DownloadMediaFile(name string) (io.ReadCloser, string, error)
- func (api *Client) GetAccount() (*Account, error)
- func (api *Client) GetAccountTransactions() ([]*AccountTransaction, error)
- func (api *Client) GetAndOrderAvailableNumbers(numberType AvailableNumberType, query *GetAvailableNumberQuery) ([]*OrderedNumber, error)
- func (api *Client) GetApplication(id string) (*Application, error)
- func (api *Client) GetApplications(query ...*GetApplicationsQuery) ([]*Application, error)
- func (api *Client) GetAvailableNumbers(numberType AvailableNumberType, query *GetAvailableNumberQuery) ([]*AvailableNumber, error)
- func (api *Client) GetBridge(id string) (*Bridge, error)
- func (api *Client) GetBridgeCalls(id string) ([]*Call, error)
- func (api *Client) GetBridges(query ...*GetBridgesQuery) ([]*Bridge, error)
- func (api *Client) GetCall(id string) (*Call, error)
- func (api *Client) GetCallEvent(id string, eventID string) (*CallEvent, error)
- func (api *Client) GetCallEvents(id string) ([]*CallEvent, error)
- func (api *Client) GetCallRecordings(id string) ([]*Recording, error)
- func (api *Client) GetCallTranscriptions(id string) ([]*Transcription, error)
- func (api *Client) GetCalls(query ...*GetCallsQuery) ([]*Call, error)
- func (api *Client) GetConference(id string) (*Conference, error)
- func (api *Client) GetConferenceMember(id string, memberID string) (*ConferenceMember, error)
- func (api *Client) GetConferenceMembers(id string) ([]*ConferenceMember, error)
- func (api *Client) GetDomainEndpoint(id string, endpointID string) (*DomainEndpoint, error)
- func (api *Client) GetDomainEndpoints(id string, query ...*GetDomainEndpointsQuery) ([]*DomainEndpoint, error)
- func (api *Client) GetDomains(query ...*GetDomainsQuery) ([]*Domain, error)
- func (api *Client) GetError(id string) (*Error, error)
- func (api *Client) GetErrors(query ...*GetErrorsQuery) ([]*Error, error)
- func (api *Client) GetGather(id string, gatherID string) (*Gather, error)
- func (api *Client) GetMediaFiles() ([]*MediaFile, error)
- func (api *Client) GetMessage(id string) (*Message, error)
- func (api *Client) GetMessages(query ...*GetMessagesQuery) ([]*Message, error)
- func (api *Client) GetNumberInfo(number string) (*NumberInfo, error)
- func (api *Client) GetPhoneNumber(idOrNumber string) (*PhoneNumber, error)
- func (api *Client) GetPhoneNumbers(query ...*GetPhoneNumbersQuery) ([]*PhoneNumber, error)
- func (api *Client) GetRecording(id string) (*Recording, error)
- func (api *Client) GetRecordingTranscription(recordingID string, transcriptionID string) (*Transcription, error)
- func (api *Client) GetRecordingTranscriptions(id string) ([]*Transcription, error)
- func (api *Client) GetRecordings(query ...*GetRecordingsQuery) ([]*Recording, error)
- func (api *Client) HangUpCall(id string) error
- func (api *Client) HoldConferenceMember(id string, memberID string, hold bool) error
- func (api *Client) MuteConference(id string, mute bool) error
- func (api *Client) MuteConferenceMember(id string, memberID string, mute bool) error
- func (api *Client) PlayAudioToBridge(id string, data *PlayAudioData) error
- func (api *Client) PlayAudioToCall(id string, data *PlayAudioData) error
- func (api *Client) PlayAudioToCallWithMap(id string, data map[string]interface{}) error
- func (api *Client) PlayAudioToConference(id string, data *PlayAudioData) error
- func (api *Client) PlayAudioToConferenceMember(id string, memberID string, data *PlayAudioData) error
- func (api *Client) RejectIncomingCall(id string) error
- func (api *Client) SendDTMFCharactersToCall(id string, dtmfOut string) error
- func (api *Client) SendDTMFToCall(id string, data *SendDTMFToCallData) error
- func (api *Client) SetCallRecodingEnabled(id string, enabled bool) error
- func (api *Client) StopGather(id string, gatherID string) error
- func (api *Client) TerminateConference(id string) error
- func (api *Client) UpdateApplication(id string, changedData *ApplicationData) error
- func (api *Client) UpdateBridge(id string, changedData *BridgeData) error
- func (api *Client) UpdateCall(id string, changedData *UpdateCallData) (string, error)
- func (api *Client) UpdateConference(id string, data *UpdateConferenceData) error
- func (api *Client) UpdateConferenceMember(id string, memberID string, data *UpdateConferenceMemberData) error
- func (api *Client) UpdateDomainEndpoint(id string, endpointID string, changedData *DomainEndpointData) error
- func (api *Client) UpdateGather(id string, gatherID string, data *UpdateGatherData) error
- func (api *Client) UpdatePhoneNumber(idOrNumber string, data *UpdatePhoneNumberData) error
- func (api *Client) UploadMediaFile(name string, file interface{}, contentType ...string) error
- type Conference
- type ConferenceMember
- type CreateCallData
- type CreateConferenceData
- type CreateConferenceMemberData
- type CreateDomainData
- type CreateGatherData
- type CreateMessageData
- type CreateMessageDataV2
- type CreateMessageResult
- type CreateMessageResultV2
- type CreatePhoneNumberData
- type Domain
- type DomainEndpoint
- type DomainEndpointCredentials
- type DomainEndpointData
- type DomainEndpointToken
- type Error
- type ErrorDetail
- type Gather
- type GatherPromptData
- type GetApplicationsQuery
- type GetAvailableNumberQuery
- type GetBridgesQuery
- type GetCallsQuery
- type GetDomainEndpointsQuery
- type GetDomainsQuery
- type GetErrorsQuery
- type GetMessagesQuery
- type GetPhoneNumbersQuery
- type GetRecordingsQuery
- type MediaFile
- type Message
- type NumberInfo
- type OrderedNumber
- type PhoneNumber
- type PhoneNumberProvider
- type PlayAudioData
- type RateLimitError
- type Recording
- type SendDTMFToCallData
- type Transcription
- type UpdateCallData
- type UpdateConferenceData
- type UpdateConferenceMemberData
- type UpdateGatherData
- type UpdatePhoneNumberData
Constants ¶
const Version = "1.0.0"
Version of this library
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountTransaction ¶
type AccountTransaction struct { ID string `json:"id"` Type string `json:"type"` Time string `json:"time"` Amount float64 `json:"amount,string"` Units int `json:"units"` ProductType string `json:"productType"` Number string `json:"number"` }
AccountTransaction struct
type Application ¶
type Application struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` IncomingCallURL string `json:"incomingCallUrl,omitempty"` IncomingCallURLCallbackTimeout int `json:"incomingCallUrlCallbackTimeout,omitempty"` IncomingCallFallbackURL string `json:"incomingCallFallbackUrl,omitempty"` IncomingMessageURL string `json:"incomingMessageUrl,omitempty"` IncomingMessageURLCallbackTimeout int `json:"incomingMessageUrlCallbackTimeout,omitempty"` IncomingMessageFallbackURL string `json:"incomingMessageFallbackUrl,omitempty"` CallbackHTTPMethod string `json:"callbackHttpMethod,omitempty"` AutoAnswer bool `json:"autoAnswer,omitempty"` }
Application struct
type ApplicationData ¶
type ApplicationData struct { Name string `json:"name,omitempty"` IncomingCallURL string `json:"incomingCallUrl,omitempty"` IncomingCallURLCallbackTimeout int `json:"incomingCallUrlCallbackTimeout,omitempty"` IncomingCallFallbackURL string `json:"incomingCallFallbackUrl,omitempty"` IncomingMessageURL string `json:"incomingMessageUrl,omitempty"` IncomingMessageURLCallbackTimeout int `json:"incomingMessageUrlCallbackTimeout,omitempty"` IncomingMessageFallbackURL string `json:"incomingMessageFallbackUrl,omitempty"` CallbackHTTPMethod string `json:"callbackHttpMethod,omitempty"` AutoAnswer bool `json:"autoAnswer,omitempty"` }
ApplicationData struct
type AvailableNumber ¶
type AvailableNumber struct { Number string `json:"number"` NationalNumber string `json:"nationalNumber"` City string `json:"city"` LATA string `json:"lata"` RateCenter string `json:"rateCenter"` State string `json:"state"` Price float64 `json:"price,string"` }
AvailableNumber struct
type AvailableNumberType ¶
type AvailableNumberType string
AvailableNumberType is allowed number types
const ( // AvailableNumberTypeLocal is local number AvailableNumberTypeLocal AvailableNumberType = "local" // AvailableNumberTypeTollFree is toll free number AvailableNumberTypeTollFree AvailableNumberType = "tollFree" )
type Bridge ¶
type Bridge struct { ID string `json:"id"` State string `json:"state"` BridgeAudio bool `json:"bridgeAudio"` CallIDs []string `json:"callIds"` CreatedTime string `json:"createdTime"` ActivatedTime string `json:"activatedTime"` CompletedTime string `json:"completedTime"` }
Bridge struct
type BridgeData ¶
type BridgeData struct { BridgeAudio bool `json:"bridgeAudio,omitempty"` CallIDs []string `json:"callIds,omitempty"` }
BridgeData struct
type Call ¶
type Call struct { ID string `json:"id"` ActiveTime string `json:"activeTime"` StartTime string `json:"startTime"` EndTime string `json:"endTime"` ChargeableDuration int `json:"chargeableDuration"` Direction string `json:"direction"` From string `json:"from"` RecordingFileFormat string `json:"recordingFileFormat"` RecordingEnabled bool `json:"recordingEnabled"` RecordingMaxDuration int `json:"recordingMaxDuration"` State string `json:"state"` To string `json:"to"` TranscriptionEnabled bool `json:"transcriptionEnabled"` SipHeaders map[string]string `json:"sipHeaders"` ConferenceID string `json:"conferenceId"` BridgeID string `json:"bridgeId"` TransferCallerID string `json:"transferCallerId"` TransferTo string `json:"transferTo"` Tag string `json:"tag"` CallbackURL string `json:"callbackUrl"` CallbackHTTPMethod string `json:"callbackHttpMethod"` FallbackURL string `json:"fallbackUrl"` CallbackTimeout int `json:"callbackTimeout"` }
Call struct
type Client ¶
type Client struct {
UserID, APIToken, APISecret string
APIEndPoint string
HTTPClient *http.Client
}
Client is main API object
func New ¶
New creates new instances of api It returns Client instance. Use it to make API calls. example: api := bandwidth.New("userId", "apiToken", "apiSecret")
func (*Client) AnswerIncomingCall ¶
AnswerIncomingCall answers an incoming call It returns error object example: api.CalAnswerIncomingCall("callId")
func (*Client) CreateApplication ¶
func (api *Client) CreateApplication(data *ApplicationData) (string, error)
CreateApplication creates an application that can handle calls and messages for one of your phone number. Many phone numbers can share an application. It returns ID of created application or error
func (*Client) CreateBridge ¶
func (api *Client) CreateBridge(data *BridgeData) (string, error)
CreateBridge creates a bridge It returns ID of created bridge
func (*Client) CreateCall ¶
func (api *Client) CreateCall(data *CreateCallData) (string, error)
CreateCall creates an outbound phone call It returns ID of created call
func (*Client) CreateConference ¶
func (api *Client) CreateConference(data *CreateConferenceData) (string, error)
CreateConference creates a new conference It returns ID of creeated conference
func (*Client) CreateConferenceMember ¶
func (api *Client) CreateConferenceMember(id string, data *CreateConferenceMemberData) (string, error)
CreateConferenceMember creates a new conference member It returns ID of created member
func (*Client) CreateDomain ¶
func (api *Client) CreateDomain(data *CreateDomainData) (string, error)
CreateDomain creates a new domain It returns ID of created domain or error
func (*Client) CreateDomainEndpoint ¶
func (api *Client) CreateDomainEndpoint(id string, data *DomainEndpointData) (string, error)
CreateDomainEndpoint creates a new endpoint for a domain It returns ID of created endpoint or error
func (*Client) CreateDomainEndpointToken ¶
func (api *Client) CreateDomainEndpointToken(id, endpointID string) (*DomainEndpointToken, error)
CreateDomainEndpointToken creates a new auth token for a domain's enpoint It returns token or error
func (*Client) CreateGather ¶
func (api *Client) CreateGather(id string, data *CreateGatherData) (string, error)
CreateGather gathers the DTMF digits pressed in a call It returns ID of created gather or error
func (*Client) CreateMessage ¶
func (api *Client) CreateMessage(data *CreateMessageData) (string, error)
CreateMessage sends a message (SMS/MMS) It returns ID of created message or error
func (*Client) CreateMessageV2 ¶
func (api *Client) CreateMessageV2(data *CreateMessageDataV2, other ...string) (*CreateMessageResultV2, error)
CreateMessageV2 sends a message (SMS/MMS)
func (*Client) CreateMessages ¶
func (api *Client) CreateMessages(data ...*CreateMessageData) ([]*CreateMessageResult, error)
CreateMessages sends some messages (SMS/MMS) It statuses of created messages or error
func (*Client) CreatePhoneNumber ¶
func (api *Client) CreatePhoneNumber(data *CreatePhoneNumberData) (string, error)
CreatePhoneNumber creates a new phone number It returns ID of created phone number or error
func (*Client) CreateRecordingTranscription ¶
CreateRecordingTranscription creates a new transcription for a recording It returns ID of created transcription or error
func (*Client) DeleteApplication ¶
DeleteApplication permanently deletes an application It returns error object
func (*Client) DeleteConferenceMember ¶
DeleteConferenceMember removes the member from the conference example: api.DeleteConferenceMember("conferenceId", "memberId")
func (*Client) DeleteDomain ¶
DeleteDomain removes a domain It returns error object
func (*Client) DeleteDomainEndpoint ¶
DeleteDomainEndpoint removes a endpoint from domain It returns error object
func (*Client) DeleteMediaFile ¶
DeleteMediaFile removes a media file It returns error object
func (*Client) DeletePhoneNumber ¶
DeletePhoneNumber removes a phone number It returns error object
func (*Client) DownloadMediaFile ¶
DownloadMediaFile download media ffile It returns error io.ReadCloser, cotent type of downloaded file or error example: stream, contentType, err := api.DownloadMediaFile("file.jpg")
func (*Client) GetAccount ¶
GetAccount returns account information (balance, etc) It returns Account instance or error
func (*Client) GetAccountTransactions ¶
func (api *Client) GetAccountTransactions() ([]*AccountTransaction, error)
GetAccountTransactions returns transactions from the user's account It returns list of AccountTransaction instances or error
func (*Client) GetAndOrderAvailableNumbers ¶
func (api *Client) GetAndOrderAvailableNumbers(numberType AvailableNumberType, query *GetAvailableNumberQuery) ([]*OrderedNumber, error)
GetAndOrderAvailableNumbers looks for available numbers and orders them
func (*Client) GetApplication ¶
func (api *Client) GetApplication(id string) (*Application, error)
GetApplication returns an user's application It returns Application instance or error
func (*Client) GetApplications ¶
func (api *Client) GetApplications(query ...*GetApplicationsQuery) ([]*Application, error)
GetApplications returns list of user's applications It returns list of Application instances or error
func (*Client) GetAvailableNumbers ¶
func (api *Client) GetAvailableNumbers(numberType AvailableNumberType, query *GetAvailableNumberQuery) ([]*AvailableNumber, error)
GetAvailableNumbers looks for available numbers
func (*Client) GetBridge ¶
GetBridge returns a bridge It returns Bridge instance fo found bridge or error
func (*Client) GetBridgeCalls ¶
GetBridgeCalls returns bridge's calls It returns list of Call instances or error
func (*Client) GetBridges ¶
func (api *Client) GetBridges(query ...*GetBridgesQuery) ([]*Bridge, error)
GetBridges returns list of previous bridges It returns list of Bridge instances or error
func (*Client) GetCall ¶
GetCall returns information about a call that was made or received It return Call instance for found call or error
func (*Client) GetCallEvent ¶
GetCallEvent returns information about one call event It returns CallEvent instance for found event or error
func (*Client) GetCallEvents ¶
GetCallEvents returns the list of call events for a call It returns list of CallEvent instances or error
func (*Client) GetCallRecordings ¶
GetCallRecordings returns all recordings related to the call It return list of Recording instances or error
func (*Client) GetCallTranscriptions ¶
func (api *Client) GetCallTranscriptions(id string) ([]*Transcription, error)
GetCallTranscriptions returns all transcriptions related to the call It return list of Transcription instances or error
func (*Client) GetCalls ¶
func (api *Client) GetCalls(query ...*GetCallsQuery) ([]*Call, error)
GetCalls returns list of previous calls that were made or received It returns list of Call instances or error
func (*Client) GetConference ¶
func (api *Client) GetConference(id string) (*Conference, error)
GetConference returns information about a conference It return Conference instance for found conference or error
func (*Client) GetConferenceMember ¶
func (api *Client) GetConferenceMember(id string, memberID string) (*ConferenceMember, error)
GetConferenceMember returns information about one conference member It returns ConferenceMember instance for found instance or error
func (*Client) GetConferenceMembers ¶
func (api *Client) GetConferenceMembers(id string) ([]*ConferenceMember, error)
GetConferenceMembers returns the list of conference members It returns list of ConferenceMember or error
func (*Client) GetDomainEndpoint ¶
func (api *Client) GetDomainEndpoint(id string, endpointID string) (*DomainEndpoint, error)
GetDomainEndpoint returns single enpoint for a domain It returns DomainEndpoint instance or error
func (*Client) GetDomainEndpoints ¶
func (api *Client) GetDomainEndpoints(id string, query ...*GetDomainEndpointsQuery) ([]*DomainEndpoint, error)
GetDomainEndpoints returns list of all endpoints for a domain It returns list of DomainEndpoint instances or error
func (*Client) GetDomains ¶
func (api *Client) GetDomains(query ...*GetDomainsQuery) ([]*Domain, error)
GetDomains returns a list of the domains that have been created It returns list of Domain instances or error
func (*Client) GetError ¶
GetError returns error by id It return Error instance for found error or error object
func (*Client) GetErrors ¶
func (api *Client) GetErrors(query ...*GetErrorsQuery) ([]*Error, error)
GetErrors returns list of errors It returns list of Error instances or error
func (*Client) GetGather ¶
GetGather returns the gather DTMF parameters and results of the call It returns Gather instance or error
func (*Client) GetMediaFiles ¶
GetMediaFiles returns a list of your media files It returns list of MediaFile instances or error
func (*Client) GetMessage ¶
GetMessage returns a single message It returns Message instance or error
func (*Client) GetMessages ¶
func (api *Client) GetMessages(query ...*GetMessagesQuery) ([]*Message, error)
GetMessages returns list of all messages It returns list of Message instances or error
func (*Client) GetNumberInfo ¶
func (api *Client) GetNumberInfo(number string) (*NumberInfo, error)
GetNumberInfo returns information fo given number It returns NumberInfo instance or error
func (*Client) GetPhoneNumber ¶
func (api *Client) GetPhoneNumber(idOrNumber string) (*PhoneNumber, error)
GetPhoneNumber returns information for phone number by id or number It returns instance of PhoneNumber or error
func (*Client) GetPhoneNumbers ¶
func (api *Client) GetPhoneNumbers(query ...*GetPhoneNumbersQuery) ([]*PhoneNumber, error)
GetPhoneNumbers returns a list of your numbers It returns list of PhoneNumber instances or error
func (*Client) GetRecording ¶
GetRecording returns a single call recording It a Recording instance or error
func (*Client) GetRecordingTranscription ¶
func (api *Client) GetRecordingTranscription(recordingID string, transcriptionID string) (*Transcription, error)
GetRecordingTranscription returns single enpoint for a recording It returns Transcription instance or error
func (*Client) GetRecordingTranscriptions ¶
func (api *Client) GetRecordingTranscriptions(id string) ([]*Transcription, error)
GetRecordingTranscriptions returns list of all transcriptions for a recording It returns list of Transcription instances or error
func (*Client) GetRecordings ¶
func (api *Client) GetRecordings(query ...*GetRecordingsQuery) ([]*Recording, error)
GetRecordings returns a list of the calls recordings It returns list of Recording instances or error
func (*Client) HangUpCall ¶
HangUpCall hangs up the call It returns error object example: api.HangUpCall("callId")
func (*Client) HoldConferenceMember ¶
HoldConferenceMember hold/unhold the conference member example: api.HoldConferenceMember("conferenceId", "memberId", true) //hold member
func (*Client) MuteConference ¶
MuteConference mutes/unmutes a conference example: api.MuteConference("conferenceId", false) //unmute it
func (*Client) MuteConferenceMember ¶
MuteConferenceMember mute/unmute the conference member example: api.MuteConferenceMember("conferenceId", "memberId", true) //mute member
func (*Client) PlayAudioToBridge ¶
func (api *Client) PlayAudioToBridge(id string, data *PlayAudioData) error
PlayAudioToBridge plays an audio or speak a sentence in a bridge It returns error object
func (*Client) PlayAudioToCall ¶
func (api *Client) PlayAudioToCall(id string, data *PlayAudioData) error
PlayAudioToCall plays an audio or speak a sentence in a call It returns error object
func (*Client) PlayAudioToCallWithMap ¶
PlayAudioToCallWithMap plays an audio or speak a sentence in a call It returns error object
func (*Client) PlayAudioToConference ¶
func (api *Client) PlayAudioToConference(id string, data *PlayAudioData) error
PlayAudioToConference plays an audio or speak a sentence in a conference It returns error object
func (*Client) PlayAudioToConferenceMember ¶
func (api *Client) PlayAudioToConferenceMember(id string, memberID string, data *PlayAudioData) error
PlayAudioToConferenceMember plays an audio or speak a sentence to a conference member It returns error object
func (*Client) RejectIncomingCall ¶
RejectIncomingCall answers an incoming call It returns error object example: api.RejectIncomingCall("callId")
func (*Client) SendDTMFCharactersToCall ¶
SendDTMFCharactersToCall sends some dtmf characters to call It returns error object example: api.SendDTMFCharactersToCall("callId", "1")
func (*Client) SendDTMFToCall ¶
func (api *Client) SendDTMFToCall(id string, data *SendDTMFToCallData) error
SendDTMFToCall plays an audio or speak a sentence in a call It returns error object
func (*Client) SetCallRecodingEnabled ¶
SetCallRecodingEnabled hangs up the call It returns error object example: api.SetCallRecodingEnabled("callId", true) // enable recording
func (*Client) StopGather ¶
StopGather stops call's gather It returns error object example: api.StopGather("callId")
func (*Client) TerminateConference ¶
TerminateConference terminates a conference example: api.TerminateConference("conferenceId")
func (*Client) UpdateApplication ¶
func (api *Client) UpdateApplication(id string, changedData *ApplicationData) error
UpdateApplication makes changes to an application It returns error object
func (*Client) UpdateBridge ¶
func (api *Client) UpdateBridge(id string, changedData *BridgeData) error
UpdateBridge adds one or two calls in a bridge and also puts the bridge on hold/unhold It returns error object
func (*Client) UpdateCall ¶
func (api *Client) UpdateCall(id string, changedData *UpdateCallData) (string, error)
UpdateCall manage an active phone call. E.g. Answer an incoming call, reject an incoming call, turn on / off recording, transfer, hang up It returns error object
func (*Client) UpdateConference ¶
func (api *Client) UpdateConference(id string, data *UpdateConferenceData) error
UpdateConference manage an active phone conference. E.g. Answer an incoming conference, reject an incoming conference, turn on / off recording, transfer, hang up It returns error object
func (*Client) UpdateConferenceMember ¶
func (api *Client) UpdateConferenceMember(id string, memberID string, data *UpdateConferenceMemberData) error
UpdateConferenceMember updates a conference member It returns error object
func (*Client) UpdateDomainEndpoint ¶
func (api *Client) UpdateDomainEndpoint(id string, endpointID string, changedData *DomainEndpointData) error
UpdateDomainEndpoint removes a endpoint from domain It returns error object
func (*Client) UpdateGather ¶
func (api *Client) UpdateGather(id string, gatherID string, data *UpdateGatherData) error
UpdateGather updates call's gather data It returns error object
func (*Client) UpdatePhoneNumber ¶
func (api *Client) UpdatePhoneNumber(idOrNumber string, data *UpdatePhoneNumberData) error
UpdatePhoneNumber makes changes to your number It returns error object
func (*Client) UploadMediaFile ¶
UploadMediaFile creates a new media from file or any io.ReadCloser instance It returns error object example: api.UploadMediaFile("file.jpg", "/path/ti/file.jpg", "image/jpeg") api.UploadMediaFile("file.bin", readCloserInstance) // using io.ReadCloser instance
type Conference ¶
type Conference struct { ID string `json:"id"` State string `json:"state"` From string `json:"from"` CreatedTime string `json:"createdTime"` CompletedTime string `json:"completedTime"` ActiveMembers int `json:"activeMembers"` CallbackURL string `json:"callbackUrl"` CallbackTimeout int `json:"callbackTimeout"` CallbackHTTPMethod string `json:"callbackHttpMethod"` FallbackURL string `json:"fallbackUrl"` Hold bool `json:"hold"` Mute bool `json:"mute"` Tag string `json:"tag"` Profile string `json:"profile"` }
Conference struct
type ConferenceMember ¶
type ConferenceMember struct { ID string `json:"id"` Call string `json:"call"` State string `json:"state"` AddedTime string `json:"addedTime"` RemovedTime string `json:"removedTime"` Hold bool `json:"hold"` Mute bool `json:"mute"` JoinTone bool `json:"joinTone"` LeavingTone bool `json:"leavingTone"` }
ConferenceMember struct
func (*ConferenceMember) GetCallID ¶
func (m *ConferenceMember) GetCallID() string
GetCallID returns call ID of member
type CreateCallData ¶
type CreateCallData struct { From string `json:"from,omitempty"` RecordingFileFormat string `json:"recordingFileFormat,omitempty"` RecordingEnabled bool `json:"recordingEnabled,omitempty"` RecordingMaxDuration int `json:"recordingMaxDuration,omitempty"` State string `json:"state,omitempty"` To string `json:"to,omitempty"` TranscriptionEnabled bool `json:"transcriptionEnabled,omitempty"` SipHeaders map[string]string `json:"sipHeaders,omitempty"` ConferenceID string `json:"conferenceId,omitempty"` BridgeID string `json:"bridgeId,omitempty"` Tag string `json:"tag,omitempty"` CallbackURL string `json:"callbackUrl,omitempty"` CallbackHTTPMethod string `json:"callbackHttpMethod,omitempty"` FallbackURL string `json:"fallbackUrl,omitempty"` CallbackTimeout int `json:"callbackTimeout,omitempty"` CallTimeout int `json:"callTimeout,omitempty"` }
CreateCallData struct
type CreateConferenceData ¶
type CreateConferenceData struct { From string `json:"from,omitempty"` CallbackURL string `json:"callbackUrl,omitempty"` CallbackTimeout int `json:"callbackTimeout,omitempty"` FallbackURL string `json:"fallbackUrl,omitempty"` Tag string `json:"tag,omitempty"` Profile string `json:"profile,omitempty"` CallbackHTTPMethod string `json:"callbackHttpMethod,omitempty"` }
CreateConferenceData struct
type CreateConferenceMemberData ¶
type CreateConferenceMemberData struct { CallID string `json:"callId"` Hold bool `json:"hold,omitempty"` Mute bool `json:"mute,omitempty"` JoinTone bool `json:"joinTone,omitempty"` LeavingTone bool `json:"leavingTone,omitempty"` }
CreateConferenceMemberData struct
type CreateDomainData ¶
type CreateDomainData struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` }
CreateDomainData struct
type CreateGatherData ¶
type CreateGatherData struct { MaxDigits int `json:"maxDigits,string,omitempty"` InterDigitTimeout int `json:"interDigitTimeout,string,omitempty"` TerminatingDigits string `json:"terminatingDigits,omitempty"` Tag string `json:"tag,omitempty"` Prompt *GatherPromptData `json:"prompt,omitempty"` }
CreateGatherData struct
type CreateMessageData ¶
type CreateMessageData struct { From string `json:"from,omitempty"` To string `json:"to,omitempty"` Text string `json:"text,omitempty"` Media []string `json:"media,omitempty"` CallbackURL string `json:"callbackUrl,omitempty"` CallbackHTTPMethod string `json:"callbackHttpMethod,omitempty"` FallbackURL string `json:"fallbackUrl,omitempty"` CallbackTimeout int `json:"callbackTimeout,omitempty"` ReceiptRequested string `json:"receiptRequested,omitempty"` Tag string `json:"tag,omitempty"` }
CreateMessageData struct
type CreateMessageDataV2 ¶
type CreateMessageDataV2 struct { From string `json:"from,omitempty"` To interface{} `json:"to,omitempty"` Text string `json:"text,omitempty"` Media []string `json:"media,omitempty"` ApplicationID string `json:"applicationId,omitempty"` Tag string `json:"tag,omitempty"` }
CreateMessageDataV2 struct
type CreateMessageResult ¶
type CreateMessageResult struct { Result string `json:"result,omitempty"` Location string `json:"location,omitempty"` ID string `json:"-"` }
CreateMessageResult stores status of sent message (in batch mode)
type CreateMessageResultV2 ¶
type CreateMessageResultV2 struct { ID string `json:"id"` Time *time.Time `json:"time,string"` From string `json:"from"` To interface{} `json:"to"` Text string `json:"text"` Media []string `json:"media"` ApplicationID string `json:"applicationId"` Tag string `json:"tag"` Direction string `json:"direction"` SegmentCount int32 `json:"segmentCount"` }
CreateMessageResultV2 stores status of sent message
type CreatePhoneNumberData ¶
type CreatePhoneNumberData struct { Number string `json:"number,omitempty"` Name string `json:"name,omitempty"` ApplicationID string `json:"applicationId,omitempty"` FallbackNumber string `json:"fallbackNumber,omitempty"` Provider *PhoneNumberProvider `json:"provider,omitempty"` }
CreatePhoneNumberData struct
type Domain ¶
type Domain struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` }
Domain struct
type DomainEndpoint ¶
type DomainEndpoint struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` DomainID string `json:"domainId"` ApplicationID string `json:"applicationId"` Enabled bool `json:"enabled"` SipURI string `json:"sipUri"` Credentials *DomainEndpointCredentials `json:"credentials"` }
DomainEndpoint struct
type DomainEndpointCredentials ¶
type DomainEndpointCredentials struct { Password string `json:"password,omitempty"` UserName string `json:"username,omitempty"` Realm string `json:"realm,omitempty"` }
DomainEndpointCredentials struct
type DomainEndpointData ¶
type DomainEndpointData struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` DomainID string `json:"domainId,omitempty"` ApplicationID string `json:"applicationId,omitempty"` Enabled bool `json:"enabled"` SipURI string `json:"sipUri,omitempty"` Credentials *DomainEndpointCredentials `json:"credentials,omitempty"` }
DomainEndpointData struct
type DomainEndpointToken ¶
DomainEndpointToken struct
type Error ¶
type Error struct { ID string `json:"id"` Category string `json:"category"` Time string `json:"time"` Code string `json:"code"` Message string `json:"message"` Details []*ErrorDetail `json:"details"` }
Error struct
type ErrorDetail ¶
type ErrorDetail struct { ID string `json:"id"` Name string `json:"name"` Value string `json:"value"` }
ErrorDetail struct
type Gather ¶
type Gather struct { ID string `json:"id"` State string `json:"state"` Reason string `json:"reason"` CreatedTime string `json:"createdTime"` CompletedTime string `json:"completedTime"` Digits string `json:"digits"` }
Gather struct
type GatherPromptData ¶
type GatherPromptData struct { FileURL string `json:"fileUrl,omitempty"` Sentence string `json:"sentence,omitempty"` Gender string `json:"gender,omitempty"` Locale string `json:"locale,omitempty"` Voice string `json:"voice,omitempty"` LoopEnabled bool `json:"loopEnabled,omitempty"` Bargeable bool `json:"bargeable, string"` }
GatherPromptData struct
type GetApplicationsQuery ¶
GetApplicationsQuery is optional parameters of GetApplications()
type GetAvailableNumberQuery ¶
type GetAvailableNumberQuery struct { City string State string Zip string AreaCode string LocalNumber string InLocalCallingArea bool Quantity int Pattern string }
GetAvailableNumberQuery is query parameters of GetAvailableNumbers() and GetAndOrderAvailableNumbers()
type GetBridgesQuery ¶
GetBridgesQuery is optional parameters of GetBridges()
type GetCallsQuery ¶
type GetCallsQuery struct { Page int Size int BridgeID string ConferenceID string From string To string SortOrder string }
GetCallsQuery is optional parameters of GetCalls()
type GetDomainEndpointsQuery ¶
GetDomainEndpointsQuery is optional parameters of GetDomainEndpoints()
type GetDomainsQuery ¶
type GetDomainsQuery struct {
Size int
}
GetDomainsQuery is optional parameters of GetDomains()
type GetErrorsQuery ¶
GetErrorsQuery is optional parameters of GetErrors()
type GetMessagesQuery ¶
type GetMessagesQuery struct { Page int Size int From string To string FromDateTime string ToDateTime string Direction string State string DeliveryState string SortOrder string }
GetMessagesQuery is optional parameters of GetMessages()
type GetPhoneNumbersQuery ¶
type GetPhoneNumbersQuery struct { Page int Size int ApplicationID string State string Name string City string NumberState string }
GetPhoneNumbersQuery is optional parameters of GetPhoneNumbers()
type GetRecordingsQuery ¶
GetRecordingsQuery is optional parameters of GetRecordings()
type MediaFile ¶
type MediaFile struct { ContentLength int64 `json:"contentLength"` Content string `json:"content"` MediaName string `json:"mediaName"` }
MediaFile struct
type Message ¶
type Message struct { ID string `json:"id"` From string `json:"from"` To string `json:"to"` Direction string `json:"direction"` Text string `json:"text"` Media []string `json:"media"` State string `json:"state"` Time string `json:"time"` CallbackURL string `json:"callbackUrl"` CallbackHTTPMethod string `json:"callbackHttpMethod,omitempty"` FallbackURL string `json:"fallbackUrl,omitempty"` CallbackTimeout int `json:"callbackTimeout,omitempty"` ReceiptRequested string `json:"receiptRequested"` DeliveryState string `json:"deliveryState"` DeliveryCode string `json:"deliveryCode"` DeliveryDescription string `json:"deliveryDescription"` Tag string `json:"tag"` }
Message struct
type NumberInfo ¶
type NumberInfo struct { Number string `json:"number"` Name string `json:"name"` Created string `json:"created"` Updated string `json:"updated"` }
NumberInfo struct
type OrderedNumber ¶
type OrderedNumber struct { Number string `json:"number"` NationalNumber string `json:"nationalNumber"` Price float64 `json:"price,string"` Location string `json:"Location"` ID string `json:"-"` }
OrderedNumber struct
type PhoneNumber ¶
type PhoneNumber struct { ID string `json:"id"` Name string `json:"name"` Number string `json:"number"` NationalNumber string `json:"nationalNumber"` City string `json:"city"` State string `json:"state"` ApplicationID string `json:"applicationId"` FallbackNumber string `json:"fallbackNumber"` CreatedTime string `json:"createdTime"` NumberState string `json:"numberState"` Price float64 `json:"price,string"` }
PhoneNumber struct
type PhoneNumberProvider ¶
type PhoneNumberProvider struct { Name string `json:"providerName,omitempty"` Properties map[string]interface{} `json:"properties,omitempty"` }
PhoneNumberProvider struct
type PlayAudioData ¶
type PlayAudioData struct { FileURL string `json:"fileUrl,omitempty"` Sentence string `json:"sentence,omitempty"` Gender string `json:"gender,omitempty"` Locale string `json:"locale,omitempty"` Voice string `json:"voice,omitempty"` LoopEnabled bool `json:"loopEnabled,omitempty"` Tag string `json:"tag,omitempty"` }
PlayAudioData struct
type RateLimitError ¶
RateLimitError is error for 429 http error
func (*RateLimitError) Error ¶
func (e *RateLimitError) Error() string
type Recording ¶
type Recording struct { ID string `json:"id"` EndTime string `json:"endTime"` Media string `json:"media"` Call string `json:"call"` StartTime string `json:"startTime"` State string `json:"state"` }
Recording struct
type SendDTMFToCallData ¶
type SendDTMFToCallData struct {
DTMFOut string `json:"dtmfOut,omitempty"`
}
SendDTMFToCallData struct
type Transcription ¶
type Transcription struct { ID string `json:"id"` ChargeableDuration int `json:"chargeableDuration"` Text string `json:"text"` TextSize int `json:"textSize"` TextURL string `json:"textUrl"` Time string `json:"time"` }
Transcription struct
type UpdateCallData ¶
type UpdateCallData struct { TransferCallerID string `json:"transferCallerId,omitempty"` TransferTo string `json:"transferTo,omitempty"` RecordingEnabled bool `json:"recordingEnabled,string,omitempty"` RecordingFileFormat string `json:"recordingFileFormat,omitempty"` State string `json:"state,omitempty"` TranscriptionEnabled bool `json:"transcriptionEnabled,string,omitempty"` CallbackURL string `json:"callbackUrl,omitempty"` WhisperAudio *PlayAudioData `json:"whisperAudio,omitempty"` Tag string `json:"tag,omitempty"` }
UpdateCallData struct
type UpdateConferenceData ¶
type UpdateConferenceData struct { State string `json:"state,omitempty"` CallbackURL string `json:"callbackUrl,omitempty"` CallbackTimeout int `json:"callbackTimeout,string,omitempty"` FallbackURL string `json:"fallbackUrl,omitempty"` Hold bool `json:"hold,omitempty"` Mute bool `json:"mute,omitempty"` Tag string `json:"tag,omitempty"` CallbackHTTPMethod string `json:"callbackHttpMethod,omitempty"` }
UpdateConferenceData struct
type UpdateConferenceMemberData ¶
type UpdateConferenceMemberData struct { State string `json:"state,omitempty"` Hold bool `json:"hold,omitempty"` Mute bool `json:"mute,omitempty"` JoinTone bool `json:"joinTone,omitempty"` LeavingTone bool `json:"leavingTone,omitempty"` }
UpdateConferenceMemberData struct
type UpdateGatherData ¶
type UpdateGatherData struct {
State string `json:"state,omitempty"`
}
UpdateGatherData struct
type UpdatePhoneNumberData ¶
type UpdatePhoneNumberData struct { Name string `json:"name,omitempty"` ApplicationID string `json:"applicationId,omitempty"` FallbackNumber string `json:"fallbackNumber,omitempty"` }
UpdatePhoneNumberData struct