message

package
v0.1.1-beta Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:   "message",
	Short: "Send and manage SMS/MMS messages",
}

Cmd is the `band message` parent command.

Functions

func BuildSendBody

func BuildSendBody(opts SendOpts) map[string]interface{}

BuildSendBody builds the request body for sending a message.

func CheckAppAssociation

func CheckAppAssociation(dashClient *api.Client, acctID, appID string) (bool, string)

CheckAppAssociation verifies that a messaging application is linked to at least one location (SIP peer). If it has no associations, messages sent through it will silently vanish — 202 accepted but never delivered.

It checks both the app's associatedsippeers endpoint AND each location's applicationSettings (the assignment may only be visible from the location side).

func CheckCallbackURL

func CheckCallbackURL(dashClient *api.Client, acctID, appID string) string

CheckCallbackURL verifies that the messaging application has a callback URL that looks like a real server. Without one, delivery confirmations are lost.

func ValidateSendOpts

func ValidateSendOpts(opts SendOpts) error

ValidateSendOpts validates the send options before making the API call.

Types

type PreflightResult

type PreflightResult struct {
	Ready      bool
	NumberType cmdutil.NumberType
	CampaignID string // non-empty if assigned to a 10DLC campaign
	Message    string // human-readable status
}

PreflightResult describes whether a number is ready to send messages.

func CheckMessagingReadiness

func CheckMessagingReadiness(platClient *api.Client, acctID, fromNumber string) PreflightResult

CheckMessagingReadiness verifies that a phone number is properly provisioned for messaging. For 10DLC numbers, it checks campaign assignment via the tendlc API. For toll-free and short codes, it returns advisory messages since those checks require credentials we may not have.

type SendOpts

type SendOpts struct {
	To         []string
	From       string
	Text       string
	Media      []string
	AppID      string
	Tag        string
	Priority   string
	Expiration string
}

SendOpts holds the parameters for sending a message.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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