nexmo

package
v0.0.0-...-f50e335 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NexmoClient

type NexmoClient struct {
	Client           *http.Client
	NexmoCredentials *config.NexmoCredentials
}

func NewNexmoClient

func NewNexmoClient(c *config.NexmoCredentials) *NexmoClient

func (*NexmoClient) Send

func (c *NexmoClient) Send(ctx context.Context, opts smsapi.SendOptions) error

type SendResponse

type SendResponse struct {
	MessageCount string                `json:"message-count"`
	Messages     []SendResponseMessage `json:"messages"`
}

See https://developer.vonage.com/en/api/sms

func ParseSendResponse

func ParseSendResponse(jsonData []byte) (*SendResponse, error)

type SendResponseMessage

type SendResponseMessage struct {
	// https://developer.vonage.com/en/messaging/sms/guides/troubleshooting-sms#sms-api-error-codes
	Status string `json:"status"`

	// When error, the following fields are present.
	ErrorText string `json:"error-text,omitempty"`

	// When success, the following fields are present.
	To               string `json:"to,omitempty"`
	MessageID        string `json:"message-id,omitempty"`
	RemainingBalance string `json:"remaining-balance,omitempty"`
	MessagePirce     string `json:"message-price,omitempty"`
	Network          string `json:"network,omitempty"`
	ClientRef        string `json:"client-ref,omitempty"`
	AccountRef       string `json:"account-ref,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL