Documentation ¶
Overview ¶
Package nexmo contains Nexmo client using oficial documentation.
MIT License ¶
Copyright (c) 2016 Angel Del Castillo ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index ¶
Constants ¶
const ( // EndpointSMS Nexmo API endpoint. EndpointSMS = "https://rest.nexmo.com/sms/json?" // EndpointCall Nexmo API endpoint. EndpointCall = "https://rest.nexmo.com/call/json?" // EndpointText2Speech Nexmo API endpoint. EndpointText2Speech = "https://api.nexmo.com/tts/json?" )
Variables ¶
var ( // ErrInvalidKey returned when API KEY is empty. ErrInvalidKey = errors.New("nexmo: invalid key length") // ErrInvalidSecret returned when API SECRET is empty. ErrInvalidSecret = errors.New("nexmo: invalid key length") // ErrEmptyResponse returned if response has no messages. ErrEmptyResponse = errors.New("nexmo: response is empty") // ErrBadRequest is return when http response status // is not 200. ErrBadRequest = errors.New("nexmo: bad request") // ErrSupportNotFound returned when this package has no // implementation for some feature. See supportmap map. ErrSupportNotFound = errors.New("nexmo: feature not supported") )
Functions ¶
func NewCall ¶ added in v0.0.2
func NewCall(to, answerURL string) *call.Request
NewCall returns a new call request with only required fields. see: https://docs.nexmo.com/voice/call/request
func NewSMS ¶ added in v0.0.2
func NewSMS(to, from, text string) *sms.Request
NewSMS returns a new SMS request only with required fields. see: https://docs.nexmo.com/messaging/sms-api/api-reference#request
func NewText2Speech ¶ added in v0.0.2
func NewText2Speech(to, from, text, lang, voice string) *text2speech.Request
NewText2Speech returns a new text2speech request with only required fields.
Types ¶
type Nexmo ¶
Nexmo client
func (*Nexmo) Call ¶
Call You use Call API to make outbound calls from Nexmo virtual numbers to other phone numbers.
func (*Nexmo) Text2Speech ¶ added in v0.0.2
Text2Speech You use Text-To-Speech API to send synthesized speech or recorded sound files to a phone number
Directories ¶
Path | Synopsis |
---|---|
examples
|
|
call
Package main contains Nexmo CALL example usage.
|
Package main contains Nexmo CALL example usage. |
sms
Package main contains Nexmo SMS example usage.
|
Package main contains Nexmo SMS example usage. |
text2speech
Package main contains Nexmo Text2Speech example usage.
|
Package main contains Nexmo Text2Speech example usage. |
Package call contains Nexmo Call Request and Response.
|
Package call contains Nexmo Call Request and Response. |
Package sms contains Nexmo SMS Request and Response as in see: https://docs.nexmo.com/messaging/sms-api/api-reference MIT License Copyright (c) 2016 Angel Del Castillo Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
Package sms contains Nexmo SMS Request and Response as in see: https://docs.nexmo.com/messaging/sms-api/api-reference MIT License Copyright (c) 2016 Angel Del Castillo Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
Package text2speech contains Nexmo Text-To-Speech Request and Response.
|
Package text2speech contains Nexmo Text-To-Speech Request and Response. |