Documentation ¶
Overview ¶
Simple client for using Nexmo's communication APIs. See https://nexmo.com for more information about the APIs.
Index ¶
- Constants
- type APIError
- type AdvancedInsightRequest
- type AdvancedInsightResponse
- type ApplicationConfiguration
- type ApplicationService
- func (s *ApplicationService) CreateApplication(request CreateApplicationRequest) (*CreateApplicationResponse, *http.Response, error)
- func (s *ApplicationService) DeleteApplication(id string) (*http.Response, error)
- func (s *ApplicationService) GetApplication(id string) (*GetApplicationResponse, *http.Response, error)
- func (s *ApplicationService) ListApplications(request ListApplicationsRequest) (*ListApplicationsResponse, *http.Response, error)
- func (s *ApplicationService) ModifyApplication(id string, request ModifyApplicationRequest) (*ModifyApplicationResponse, *http.Response, error)
- func (c *ApplicationService) SetBaseURL(baseURL string)
- type AuthSet
- type AuthType
- type BasicInsightRequest
- type BasicInsightResponse
- type CallErrorResponse
- type CallInfo
- type CallService
- func (c *CallService) CreateCall(request CreateCallRequest) (*CreateCallResponse, *http.Response, error)
- func (c *CallService) GetCallInfo(uuid string) (*CallInfo, *http.Response, error)
- func (c *CallService) ModifyCall(uuid string, request interface{}) (*ModifyCallResponse, *http.Response, error)
- func (c *CallService) SearchCalls(request SearchCallsRequest) (*SearchCallsResponse, *http.Response, error)
- func (c *CallService) SendDTMF(uuid string, request DTMFRequest) (*ModifyCallResponse, *http.Response, error)
- func (c *CallService) SetBaseURL(baseURL string)
- func (c *CallService) StopStream(uuid string) (*ModifyCallResponse, *http.Response, error)
- func (c *CallService) StopTalk(uuid string) (*ModifyCallResponse, *http.Response, error)
- func (c *CallService) Stream(uuid string, request StreamRequest) (*ModifyCallResponse, *http.Response, error)
- func (c *CallService) Talk(uuid string, request TalkRequest) (*ModifyCallResponse, *http.Response, error)
- type CallerType
- type CarrierRecord
- type CheckVerificationRequest
- type CheckVerificationResponse
- type Client
- type ControlVerificationRequest
- type ControlVerificationResponse
- type CountryPrices
- type CreateApplicationRequest
- type CreateApplicationResponse
- type CreateCallRequest
- type CreateCallResponse
- type Credentials
- type DTMFRequest
- type DeveloperService
- func (s *DeveloperService) GetBalance() (*GetBalanceResponse, *http.Response, error)
- func (s *DeveloperService) GetOutboundPricingForCountry(request GetOutboundPricingForCountryRequest) (*CountryPrices, *http.Response, error)
- func (s *DeveloperService) GetOutboundProductPricing(request GetOutboundProductPricingRequest) (*GetOutboundProductPricingResponse, *http.Response, error)
- func (s *DeveloperService) GetPhoneOutboundPricing(request GetPhoneOutboundPricingRequest) (*GetPhoneOutboundPricingResponse, *http.Response, error)
- func (s *DeveloperService) GetPrefixOutboundPricing(request GetPrefixOutboundPricingRequest) (*GetPrefixOutboundPricingResponse, *http.Response, error)
- func (c *DeveloperService) SetBaseURL(baseURL string)
- type EmbeddedCalls
- type GetApplicationRequest
- type GetApplicationResponse
- type GetBalanceResponse
- type GetOutboundPricingForCountryRequest
- type GetOutboundProductPricingRequest
- type GetOutboundProductPricingResponse
- type GetPhoneOutboundPricingRequest
- type GetPhoneOutboundPricingResponse
- type GetPrefixOutboundPricingRequest
- type GetPrefixOutboundPricingResponse
- type IPMatchLevel
- type IPWarnings
- type InsightService
- func (c *InsightService) GetAdvancedInsight(request AdvancedInsightRequest) (AdvancedInsightResponse, *http.Response, error)
- func (c *InsightService) GetBasicInsight(request BasicInsightRequest) (BasicInsightResponse, *http.Response, error)
- func (c *InsightService) GetStandardInsight(request StandardInsightRequest) (StandardInsightResponse, *http.Response, error)
- func (c *InsightService) SetBaseURL(baseURL string)
- type Link
- type Links
- type ListApplicationsRequest
- type ListApplicationsResponse
- type LookupOutcome
- type MessageType
- type ModifyApplicationRequest
- type ModifyApplicationResponse
- type ModifyCallResponse
- type NetworkDetails
- type NetworkPrice
- type NetworkType
- type PhoneCallEndpoint
- type PortedStatus
- type RandomProvider
- type ReachableStatus
- type RoamingStatus
- type SIPCallEndpoint
- type SMSService
- type SearchCallsRequest
- type SearchCallsResponse
- type SearchVerificationRequest
- type SearchVerificationResponse
- type SendSMSRequest
- type SendSMSResponse
- type SendSMSResponseMessage
- type SimpleModifyCallRequest
- type StandardInsightRequest
- type StandardInsightResponse
- type StartVerificationRequest
- type StartVerificationResponse
- type StreamRequest
- type TalkRequest
- type TransferCallRequest
- type TransferDestination
- type ValidNumberStatus
- type VerifyService
- func (s *VerifyService) Check(request CheckVerificationRequest) (*CheckVerificationResponse, *http.Response, error)
- func (s *VerifyService) Control(request ControlVerificationRequest) (*ControlVerificationResponse, *http.Response, error)
- func (s *VerifyService) Search(request SearchVerificationRequest) (*SearchVerificationResponse, *http.Response, error)
- func (s *VerifyService) SetBaseURL(baseURL string)
- func (s *VerifyService) Start(request StartVerificationRequest) (*StartVerificationResponse, *http.Response, error)
- type WebSocketCallEndpoint
Constants ¶
const ( PortedStatusUnknown PortedStatus = "unknown" PortedStatusPorted PortedStatus = "ported" PortedStatusNotPorted PortedStatus = "not_ported" PortedStatusAssumedPorted PortedStatus = "assumed_ported" PortedStatusAssumedNotPorted PortedStatus = "assumed_not_ported" CallerTypeBusiness CallerType = "business" CallerTypeConsumer CallerType = "consumer" CallerTypeUnknown CallerType = "unknown" )
const ( RoamingStatusRoaming RoamingStatus = "roaming" RoamingStatusUnknown RoamingStatus = "unkown" RoamingStatusNotRoaming RoamingStatus = "not_roaming" ValidNumberStatusValid ValidNumberStatus = "valid" ValidNumberStatusUnknown ValidNumberStatus = "unknown" ValidNumberStatusNotValid ValidNumberStatus = "not_valid" ReachableStatusUnknown ReachableStatus = "unknown" ReachableStatusReachable ReachableStatus = "reachable" ReachableStatusUndeliverable ReachableStatus = "undeliverable" ReachableStatusAbsent ReachableStatus = "absent" ReachableStatusBadNumber ReachableStatus = "bad_number" ReachableStatusBlacklisted ReachableStatus = "blacklisted" IPMatchLevelCountry IPMatchLevel = "country" IPMatchLevelMismatch IPMatchLevel = "mismatch" IPWarningsUnknown IPWarnings = "unknown" IPWarningsNoWarning IPWarnings = "no_warning" LookupOutcomeSuccess LookupOutcome = iota LookupOutcomePartial LookupOutcomeFailed )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdvancedInsightRequest ¶
type AdvancedInsightRequest struct { Credentials Number string `json:"number,omitempty"` Country string `json:"country,omitempty"` CNAM bool `json:"cnam,omitempty"` IP string `json:"ip,omitempty"` }
type AdvancedInsightResponse ¶
type AdvancedInsightResponse struct { StandardInsightResponse ValidNumber ValidNumberStatus `json:"valid_number"` Reachable ReachableStatus `json:"reachable"` Ported string `json:"ported"` Roaming struct { Status RoamingStatus `json:"status"` RoamingCountryCode string `json:"roaming_country_code"` RoamingNetworkCode string `json:"roaming_network_code"` RoamingNetworkName string `json:"roaming_network_name"` } `json:"roaming"` LookupOutcome LookupOutcome `json:"lookup_outcome"` LookupOutcomeMessage string `json:"lookup_outcome_message"` IP string `json:"ip"` IPWarnings IPWarnings `json:"ip_warnings"` IPMatchLevel IPMatchLevel `json:"ip_match_level"` IPCountry string `json:"ip_country"` }
type ApplicationConfiguration ¶
type ApplicationConfiguration struct { ID string `json:"id"` Name string `json:"name"` Voice struct { Webhooks []struct { EndpointType string `json:"endpoint_type"` Endpoint string `json:"endpoint"` HTTPMethod string `json:"http_method"` } `json:"webhooks"` } Keys struct { PublicKey string `json:"public_key"` PrivateKey string `json:"private_key"` } `json:"keys"` Links Links `json:"_links"` }
type ApplicationService ¶
type ApplicationService struct {
// contains filtered or unexported fields
}
Use the Application API to create and manage your applications. More info: https://developer.nexmo.com/application
func (*ApplicationService) CreateApplication ¶
func (s *ApplicationService) CreateApplication(request CreateApplicationRequest) (*CreateApplicationResponse, *http.Response, error)
Create a new application in your Nexmo account
func (*ApplicationService) DeleteApplication ¶
func (s *ApplicationService) DeleteApplication(id string) (*http.Response, error)
Destroy an application
func (*ApplicationService) GetApplication ¶
func (s *ApplicationService) GetApplication(id string) (*GetApplicationResponse, *http.Response, error)
Fetch a specific application's details
func (*ApplicationService) ListApplications ¶
func (s *ApplicationService) ListApplications(request ListApplicationsRequest) (*ListApplicationsResponse, *http.Response, error)
List the applications on the Nexmo account
func (*ApplicationService) ModifyApplication ¶
func (s *ApplicationService) ModifyApplication(id string, request ModifyApplicationRequest) (*ModifyApplicationResponse, *http.Response, error)
Update an existing application by applying changed config to it
func (*ApplicationService) SetBaseURL ¶
func (c *ApplicationService) SetBaseURL(baseURL string)
Set the base URL for the API calls. Useful for testing.
type AuthSet ¶
type AuthSet struct {
// contains filtered or unexported fields
}
API credentials to access the Nexmo APIs
func NewAuthSet ¶
func NewAuthSet() *AuthSet
func (*AuthSet) ApplyAPICredentials ¶
func (a *AuthSet) ApplyAPICredentials(request apiSecretRequest)
func (*AuthSet) GenerateToken ¶
func (*AuthSet) SetAPISecret ¶
type BasicInsightRequest ¶
type BasicInsightRequest struct { Credentials Number string `json:"number,omitempty"` Country string `json:"country,omitempty"` }
type BasicInsightResponse ¶
type BasicInsightResponse struct { Status int64 `json:"status,omitempty"` StatusMessage string `json:"status_message,omitempty"` ErrorText string `json:"error_text,omitempty"` RequestID string `json:"request_id,omitempty"` InternationalFormatNumber string `json:"international_format_number,omitempty"` NationalFormatNumber string `json:"national_format_number,omitempty"` CountryCode string `json:"country_code,omitempty"` CountryCodeIso3 string `json:"country_code_iso3,omitempty"` CountryName string `json:"country_name,omitempty"` CountryPrefix string `json:"country_prefix,omitempty"` }
type CallErrorResponse ¶
type CallErrorResponse struct { Type string `json:"type,omitempty"` ErrorTitle string `json:"error_title,omitempty"` }
func (*CallErrorResponse) Error ¶
func (c *CallErrorResponse) Error() string
type CallInfo ¶
type CallInfo struct { UUID string `json:"uuid,omitempty"` ConversationUUID string `json:"conversation_uuid,omitempty"` To interface{} `json:"to,omitempty"` From interface{} `json:"from,omitempty"` Status string `json:"status,omitempty"` Direction string `json:"direction,omitempty"` Rate string `json:"rate,omitempty"` Price string `json:"price,omitempty"` Duration string `json:"duration,omitempty"` Network string `json:"network,omitempty"` StartTime string `json:"start_time,omitempty"` EndTime string `json:"end_time,omitempty"` }
type CallService ¶
type CallService struct {
// contains filtered or unexported fields
}
For working with the Voice API. More information about Voice: https://developer.nexmo.com/voice/voice-api/
func (*CallService) CreateCall ¶
func (c *CallService) CreateCall(request CreateCallRequest) (*CreateCallResponse, *http.Response, error)
CreateCall starts a voice call, configured using the provided CreateCallRequest.
func (*CallService) GetCallInfo ¶
Get information about a current or past call by call ID
func (*CallService) ModifyCall ¶
func (c *CallService) ModifyCall(uuid string, request interface{}) (*ModifyCallResponse, *http.Response, error)
Change the in-progress call by performing an action, such as hangup, transfer, mute, etc. See the API reference: https://developer.nexmo.com/api/voice#updateCall
func (*CallService) SearchCalls ¶
func (c *CallService) SearchCalls(request SearchCallsRequest) (*SearchCallsResponse, *http.Response, error)
SearchCalls returns information about calls matching the filter in the provided SearchCallsRequest
func (*CallService) SendDTMF ¶
func (c *CallService) SendDTMF(uuid string, request DTMFRequest) (*ModifyCallResponse, *http.Response, error)
Play DTMF tones into a call
func (*CallService) SetBaseURL ¶
func (c *CallService) SetBaseURL(baseURL string)
Set the base URL for the API requests. Mostly useful for testing.
func (*CallService) StopStream ¶
func (c *CallService) StopStream(uuid string) (*ModifyCallResponse, *http.Response, error)
Stop the audio stream from playing in a call
func (*CallService) StopTalk ¶
func (c *CallService) StopTalk(uuid string) (*ModifyCallResponse, *http.Response, error)
Stop the text-to-speech that is currently being sent into a call
func (*CallService) Stream ¶
func (c *CallService) Stream(uuid string, request StreamRequest) (*ModifyCallResponse, *http.Response, error)
Start playing an audio file into a call
func (*CallService) Talk ¶
func (c *CallService) Talk(uuid string, request TalkRequest) (*ModifyCallResponse, *http.Response, error)
Send text-to-speech into a call
type CallerType ¶
type CallerType string
type CarrierRecord ¶
type CarrierRecord struct { NetworkCode string `json:"network_code"` Name string `json:"name"` Country string `json:"country"` NetworkType NetworkType `json:"network_type"` }
type CheckVerificationRequest ¶
type CheckVerificationRequest struct { Credentials RequestID string `json:"request_id"` Code string `json:"code"` IPAddress string `json:"ip_address,omitempty"` }
type Client ¶
type Client struct { Insight *InsightService SMS *SMSService Call *CallService Verify *VerifyService Developer *DeveloperService Application *ApplicationService // contains filtered or unexported fields }
The main client object
type ControlVerificationRequest ¶
type ControlVerificationRequest struct { Credentials RequestID string `json:"request_id"` Command string `json:"cmd"` }
type CountryPrices ¶
type CountryPrices struct { MT string `json:"mt"` Country string `json:"country"` Prefix string `json:"prefix"` Name string `json:"name"` Networks []NetworkPrice `json:"networks"` }
type CreateApplicationResponse ¶
type CreateApplicationResponse ApplicationConfiguration
type CreateCallRequest ¶
type CreateCallRequest struct { To []interface{} `json:"to"` From interface{} `json:"from"` AnswerURL []string `json:"answer_url"` AnswerMethod string `json:"answer_method,omitempty"` EventURL []string `json:"event_url,omitempty"` EventMethod string `json:"event_method,omitempty"` MachineDetection string `json:"machine_detection,omitempty"` LengthTimer int64 `json:"length_timer,omitempty"` RingingTimer int64 `json:"ringing_timer,omitempty"` }
type CreateCallResponse ¶
type Credentials ¶
type DTMFRequest ¶
type DTMFRequest struct {
Digits string `json:"digits"`
}
type DeveloperService ¶
type DeveloperService struct {
// contains filtered or unexported fields
}
Developer API allows configuration of account and balance checking. See also: https://developer.nexmo.com/api/account
func (*DeveloperService) GetBalance ¶
func (s *DeveloperService) GetBalance() (*GetBalanceResponse, *http.Response, error)
Get the current balance of your account
func (*DeveloperService) GetOutboundPricingForCountry ¶
func (s *DeveloperService) GetOutboundPricingForCountry(request GetOutboundPricingForCountryRequest) (*CountryPrices, *http.Response, error)
GetOutboundPricingForCountry requests pricing for a given country
func (*DeveloperService) GetOutboundProductPricing ¶
func (s *DeveloperService) GetOutboundProductPricing(request GetOutboundProductPricingRequest) (*GetOutboundProductPricingResponse, *http.Response, error)
GetOutboundProductPricing requests prices for a product in a given country
func (*DeveloperService) GetPhoneOutboundPricing ¶
func (s *DeveloperService) GetPhoneOutboundPricing(request GetPhoneOutboundPricingRequest) (*GetPhoneOutboundPricingResponse, *http.Response, error)
GetPhoneOutboundPricing requests outbound pricing for a given phone number
func (*DeveloperService) GetPrefixOutboundPricing ¶
func (s *DeveloperService) GetPrefixOutboundPricing(request GetPrefixOutboundPricingRequest) (*GetPrefixOutboundPricingResponse, *http.Response, error)
GetPrefixOutboundPricing requests outbound pricing for a given international prefix
func (*DeveloperService) SetBaseURL ¶
func (c *DeveloperService) SetBaseURL(baseURL string)
Set the base URL for the API request, useful for testing
type EmbeddedCalls ¶
type EmbeddedCalls struct {
Calls []CallInfo `json:"calls,omitempty"`
}
type GetApplicationRequest ¶
type GetApplicationRequest struct { // Created with embedded Credentials, so this will support setApiCredentials // (if we alias to Credentials, we lose the implementation) Credentials }
type GetApplicationResponse ¶
type GetApplicationResponse ApplicationConfiguration
type GetBalanceResponse ¶
type GetBalanceResponse struct {
Value float64 `json:"value,omitempty"`
}
type GetOutboundPricingForCountryRequest ¶
type GetOutboundPricingForCountryRequest struct { Credentials Country string `url:"country"` }
type GetOutboundProductPricingRequest ¶
type GetOutboundProductPricingRequest struct { Credentials Product string `url:"-"` Country string `url:"country"` }
type GetOutboundProductPricingResponse ¶
type GetOutboundProductPricingResponse struct { DialingPrefix string `json:"dialingPrefix"` DefaultPrice string `json:"defaultPrice"` Currency string `json:"currency"` CountryDisplayName string `json:"countryDisplayName"` CountryCode string `json:"countryCode"` CountryName string `json:"countryName"` Networks []NetworkDetails `json:"networks"` }
type GetPhoneOutboundPricingRequest ¶
type GetPhoneOutboundPricingRequest struct { // This is defined here because Product must not be serialized, and I haven't implemented that in the json-schema Credentials Phone string `url:"phone"` Product string `url:"-"` }
GetPhoneOutboundPricingRequest is the request object for DeveloperService.GetPhoneOutboundPricing
type GetPrefixOutboundPricingRequest ¶
type GetPrefixOutboundPricingRequest struct { Credentials Prefix string `url:"prefix"` }
type GetPrefixOutboundPricingResponse ¶
type GetPrefixOutboundPricingResponse struct { Count int64 `json:"count"` Prices []CountryPrices `json:"prices"` }
type IPMatchLevel ¶
type IPMatchLevel string
type IPWarnings ¶
type IPWarnings string
type InsightService ¶
type InsightService struct {
// contains filtered or unexported fields
}
Number Insights provides information at varying levels of detail (basic/standard/advanced) about a phone number. For more information, visit the developer documentation https://developer.nexmo.com/number-insight
func (*InsightService) GetAdvancedInsight ¶
func (c *InsightService) GetAdvancedInsight(request AdvancedInsightRequest) (AdvancedInsightResponse, *http.Response, error)
Perform a Number Insight request at an advanced level of detail
func (*InsightService) GetBasicInsight ¶
func (c *InsightService) GetBasicInsight(request BasicInsightRequest) (BasicInsightResponse, *http.Response, error)
Perform a Number Insight request at a basic level of detail
func (*InsightService) GetStandardInsight ¶
func (c *InsightService) GetStandardInsight(request StandardInsightRequest) (StandardInsightResponse, *http.Response, error)
Perform a Number Insight request at a standard level of detail
func (*InsightService) SetBaseURL ¶
func (c *InsightService) SetBaseURL(baseURL string)
Set the base URL for the API request. This is mostly useful for testing.
type ListApplicationsRequest ¶
type ListApplicationsRequest struct { Credentials PageSize int64 `url:"page_size,omitempty"` PageIndex int64 `url:"page_index,omitempty"` }
type ListApplicationsResponse ¶
type ListApplicationsResponse struct { Count int64 `json:"count,omitempty"` PageSize int64 `json:"page_size,omitempty"` Embedded struct { Applications []ApplicationConfiguration `json:"applications"` } `json:"_embedded"` Links Links `json:"_links"` }
type LookupOutcome ¶
type LookupOutcome int8
type MessageType ¶
type MessageType string
const ( MessageTypeText MessageType = "text" MessageTypeBinary MessageType = "binary" MessageTypeWAPPush MessageType = "wappush" MessageTypeUnicode MessageType = "unicode" )
type ModifyApplicationRequest ¶
type ModifyApplicationRequest CreateApplicationRequest
type ModifyApplicationResponse ¶
type ModifyApplicationResponse ApplicationConfiguration
type ModifyCallResponse ¶
type NetworkDetails ¶
type NetworkPrice ¶
type NetworkType ¶
type NetworkType string
const ( NetworkTypeMobile NetworkType = "mobile" NetworkTypeLandline NetworkType = "landline" NetworkTypeLandlinePremium NetworkType = "landline_premium" NetworkTypeLandlineTollFree NetworkType = "landline_tollfree" NetworkTypeVirtual NetworkType = "virtual" NetworkTypeUnknown NetworkType = "unknown" NetworkTypePager NetworkType = "pager" )
type PhoneCallEndpoint ¶
type PortedStatus ¶
type PortedStatus string
type RandomProvider ¶
type RandomProvider interface {
Int31() int32
}
type ReachableStatus ¶
type ReachableStatus string
type RoamingStatus ¶
type RoamingStatus string
type SIPCallEndpoint ¶
type SMSService ¶
type SMSService struct {
// contains filtered or unexported fields
}
Work with the SMS API to send SMS messges. More information about this API: https://developer.nexmo.com/messaging/sms
func (*SMSService) SendSMS ¶
func (c *SMSService) SendSMS(request SendSMSRequest) (*SendSMSResponse, *http.Response, error)
Send an SMS message
func (*SMSService) SetBaseURL ¶
func (c *SMSService) SetBaseURL(baseURL string)
type SearchCallsRequest ¶
type SearchCallsRequest struct { Status string `url:"status,omitempty"` DateStart string `url:"date_start,omitempty"` DateEnd string `url:"date_end,omitempty"` PageSize int64 `url:"page_size,omitempty"` RecordIndex int64 `url:"record_index,omitempty"` Order string `url:"order,omitempty"` ConversationUUID string `url:"conversation_uuid,omitempty"` }
type SearchCallsResponse ¶
type SearchCallsResponse struct { Count int64 `json:"count,omitempty"` PageSize int64 `json:"page_size,omitempty"` RecordIndex int64 `json:"record_index,omitempty"` Links Links `json:"_links,omitempty"` Embedded EmbeddedCalls `json:"_embedded,omitempty"` }
type SearchVerificationRequest ¶
type SearchVerificationRequest struct { Credentials RequestIDs []string `json:"request_ids" url:"request_ids"` }
type SearchVerificationResponse ¶
type SearchVerificationResponse struct { Status string `json:"status"` ErrorText string `json:"error_text"` VerificationRequests []struct { RequestID string `json:"request_id"` AccountID string `json:"account_id"` Number string `json:"number"` SenderID string `json:"sender_id"` DateSubmitted string `json:"date_submitted"` DateFinalized string `json:"date_finalized"` FirstEventDate string `json:"first_event_date"` LastEventDate string `json:"last_event_date"` Status string `json:"status"` Price string `json:"price"` Currency string `json:"currency"` Checks []struct { DateReceived string `json:"date_received"` Code string `json:"code"` Status string `json:"status"` IPAddress string `json:"ip_address"` } `json:"checks"` } `json:"verification_requests"` }
type SendSMSRequest ¶
type SendSMSRequest struct { APIKey string `json:"api_key"` APISecret string `json:"api_secret"` From string `json:"from,omitempty"` To string `json:"to,omitempty"` Type MessageType `json:"type,omitempty"` Text string `json:"text,omitempty"` StatusReportReq int64 `json:"status-report-req,omitempty"` ClientRef string `json:"client-ref,omitempty"` Vcard string `json:"vcard,omitempty"` Vcal string `json:"vcal,omitempty"` TTL int64 `json:"ttl,omitempty"` Callback string `json:"callback,omitempty"` MessageClass int64 `json:"message-class,omitempty"` Udh string `json:"udh,omitempty"` ProtocolID int64 `json:"protocol-id,omitempty"` Body string `json:"body,omitempty"` Title string `json:"title,omitempty"` URL string `json:"url,omitempty"` Validity int64 `json:"validity,omitempty"` }
type SendSMSResponse ¶
type SendSMSResponse struct { MessageCount string `json:"message-count,omitempty"` Messages []SendSMSResponseMessage `json:"messages,omitempty"` }
type SendSMSResponseMessage ¶
type SendSMSResponseMessage struct { Status string `json:"status,omitempty"` MessageID string `json:"message-id,omitempty"` To string `json:"to,omitempty"` ClientRef string `json:"client-ref,omitempty"` RemainingBalance string `json:"remaining-balance,omitempty"` MessagePrice string `json:"message-price,omitempty"` Network string `json:"network,omitempty"` ErrorText string `json:"error-text,omitempty"` }
type SimpleModifyCallRequest ¶
type SimpleModifyCallRequest struct {
Action string `json:"action,omitempty"`
}
type StandardInsightRequest ¶
type StandardInsightRequest struct { Credentials Number string `json:"number,omitempty"` Country string `json:"country,omitempty"` CNAM bool `json:"cnam,omitempty"` }
type StandardInsightResponse ¶
type StandardInsightResponse struct { BasicInsightResponse RequestPrice string `json:"request_price"` RefundPrice string `json:"refund_price"` RemainingBalance string `json:"remaining_balance"` Ported PortedStatus `json:"ported"` CurrentCarrier *CarrierRecord `json:"current_carrier,omitempty"` OriginalCarrier *CarrierRecord `json:"original_carrier,omitempty"` // CNAM fields: CallerName string `json:"caller_name"` LastName string `json:"last_name"` FirstName string `json:"first_name"` CallerType CallerType `json:"caller_type"` }
type StartVerificationRequest ¶
type StartVerificationRequest struct { Credentials Number string `json:"number"` Brand string `json:"brand"` Country string `json:"country,omitempty"` SenderID string `json:"sender_id,omitempty"` CodeLength int8 `json:"code_length,omitempty"` LG string `json:"lg,omitempty"` RequireType string `json:"require_type,omitempty"` PINExpiry int16 `json:"pin_expiry,omitempty"` NextEventWait int16 `json:"next_event_wait,omitempty"` WorkflowID int8 `json:"workflow_id,omitempty"` }
type StreamRequest ¶
type TalkRequest ¶
type TransferCallRequest ¶
type TransferCallRequest struct { Action string `json:"action,omitempty"` Destination TransferDestination `json:"destination,omitempty"` }
type TransferDestination ¶
type ValidNumberStatus ¶
type ValidNumberStatus string
type VerifyService ¶
type VerifyService struct {
// contains filtered or unexported fields
}
Use Verify API for 2FA, passwordless login, or confirming that a user has given a correct phone number. More information: https://developer.nexmo.com/verify
func (*VerifyService) Check ¶
func (s *VerifyService) Check(request CheckVerificationRequest) (*CheckVerificationResponse, *http.Response, error)
Check if the code the user supplied is correct for this request
func (*VerifyService) Control ¶
func (s *VerifyService) Control(request ControlVerificationRequest) (*ControlVerificationResponse, *http.Response, error)
The control endpoint allows cancellation of a request or moving to the next verification stage
func (*VerifyService) Search ¶
func (s *VerifyService) Search(request SearchVerificationRequest) (*SearchVerificationResponse, *http.Response, error)
Search for current or past verify requests, their costs and statuses
func (*VerifyService) SetBaseURL ¶
func (s *VerifyService) SetBaseURL(baseURL string)
func (*VerifyService) Start ¶
func (s *VerifyService) Start(request StartVerificationRequest) (*StartVerificationResponse, *http.Response, error)
Begin the process of verifying a phone number, you probably want to capture the request_id